Skip to content

Fix pretty print for RealParameter and IntegerParameter#255

Merged
quaquel merged 3 commits intomasterfrom
ParameterBugfixes
Apr 19, 2023
Merged

Fix pretty print for RealParameter and IntegerParameter#255
quaquel merged 3 commits intomasterfrom
ParameterBugfixes

Conversation

@quaquel
Copy link
Copy Markdown
Owner

@quaquel quaquel commented Apr 18, 2023

This PR enhances the string representation of RealParameter and IntegerParameter instances by adding a __repr__() method to both classes. The new representation includes all relevant information about the parameters, such as name, lower and upper bounds, resolution, default value, variable name, and pff status.

Changes:

  • Added __repr__() method to RealParameter class
  • Added __repr__() method to IntegerParameter class

@quaquel quaquel added the bug label Apr 18, 2023
@quaquel quaquel requested a review from EwoutH April 18, 2023 08:32
@quaquel quaquel added this to the 2.4.0 milestone Apr 18, 2023
@EwoutH EwoutH changed the title bugfix for pretty print of RealParameter and IntegerParameter Improve pretty print for RealParameter and IntegerParameter Apr 18, 2023
Copy link
Copy Markdown
Collaborator

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a useful improvement to make prints more readable!

For the label, is it a bugfix or enhancement?

PS: I'm sometimes also to lazy, tired or time-limited to write a commit message. Here's my solution:

Put .diff after the GitHub URL of your PR or commit message (i.e. https://github.com/quaquel/EMAworkbench/pull/255.diff, throw it in ChatGPT and ask to write a commit message and quickly check if it's correct. Works amazing about 85% of the time for me!

@quaquel
Copy link
Copy Markdown
Owner Author

quaquel commented Apr 18, 2023

It's a bug fix, because this used to work fine in the past. And it did still work fine for some Parameter classes (e.g. categorical)

@EwoutH EwoutH changed the title Improve pretty print for RealParameter and IntegerParameter Fix pretty print for RealParameter and IntegerParameter Apr 18, 2023
BooleanParameter.__repr__ added
@quaquel quaquel merged commit 1256560 into master Apr 19, 2023
@quaquel quaquel deleted the ParameterBugfixes branch April 19, 2023 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants