Skip to content

em_framework/points: Add string representation to Experiment class#297

Merged
quaquel merged 3 commits intomasterfrom
points-repr
Oct 26, 2023
Merged

em_framework/points: Add string representation to Experiment class#297
quaquel merged 3 commits intomasterfrom
points-repr

Conversation

@EwoutH
Copy link
Copy Markdown
Collaborator

@EwoutH EwoutH commented Oct 13, 2023

Small cherry pick from #292 to give the Experiment class in points.py a string representation. This can be useful for keeping track of different experiments being performed while logging.

@EwoutH EwoutH requested a review from quaquel October 13, 2023 17:40
@coveralls
Copy link
Copy Markdown

coveralls commented Oct 13, 2023

Coverage Status

coverage: 80.893% (-0.02%) from 80.915% when pulling 68ef4ae on points-repr into 211699b on master.

Copy link
Copy Markdown
Owner

@quaquel quaquel left a comment

Choose a reason for hiding this comment

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

The basic idea is fine. However, repr ideally should return something that can be used to reinstantiate the object. The current information is not correctly formatted for this. See e.g., https://realpython.com/python-repr-vs-str/ for details

EwoutH and others added 2 commits October 14, 2023 18:17
.__repr__() provides the formal string representation of an object, aimed at the programmer.
.__str__() provides the informal string representation of an object, aimed at the user.
@EwoutH
Copy link
Copy Markdown
Collaborator Author

EwoutH commented Oct 14, 2023

Thanks for reviewing, good point. How does this look?

(if good, please squash when merging)

@EwoutH
Copy link
Copy Markdown
Collaborator Author

EwoutH commented Oct 26, 2023

@quaquel Any further comments?

@quaquel quaquel merged commit b76b487 into master Oct 26, 2023
@quaquel quaquel deleted the points-repr branch October 26, 2023 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants