-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add petab.Problem.__str__ #178
Conversation
... providing some high-level summary of the given problem.
Codecov Report
@@ Coverage Diff @@
## develop #178 +/- ##
===========================================
- Coverage 78.46% 78.21% -0.26%
===========================================
Files 30 30
Lines 2652 2662 +10
Branches 605 606 +1
===========================================
+ Hits 2081 2082 +1
- Misses 412 421 +9
Partials 159 159
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
if self.parameter_df is not None: | ||
num_estimated_parameters = sum(self.parameter_df[ESTIMATE] == 1) \ | ||
if ESTIMATE in self.parameter_df \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESTIMATE
is a required column
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. Not sure how much we want to assume/require correctness here. Should it just fail if this is missing? Should we validate in __str__
?
Might be more convenient to allow for some slack, if this is used during assembling a Problem. Similar to libsbml where one is allowed to create invalid models.
@@ -104,6 +104,31 @@ def __setattr__(self, name, value): | |||
else: | |||
super().__setattr__(name, value) | |||
|
|||
def __str__(self): | |||
model = f"with model ({self.model})" if self.model else "without model" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Model
has no __str__
, what gets printed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the not so informative default __repr__
. The plan would be to add something more meaningful there as well.
... providing some high-level summary of the given problem.