Repository navigation
v1: validate and consistently interpret estimate values
#650
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2a021df
v1: validate and consistently interpret `estimate` values
dweindl 6f512da
Changelog: link PR
dweindl 7d94c25
v1 lint: vectorize `check_parameter_bounds`, report missing bounds
dweindl ce0cb00
v1: parse parameter table values with `pd.to_numeric`
dweindl 8da2c7e
Restore `numbers` import
dweindl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| PEtab v1 validation: invalid `estimate` values and non-numeric | ||
| `lowerBound`, `upperBound`, and `nominalValue` values are now reported as | ||
| errors naming the affected parameters, instead of crashing `lint_problem` | ||
| or passing silently. | ||
| Missing bounds of estimated parameters are reported as such, instead of as | ||
| `lowerBound` greater than `upperBound`, and bound checks report all | ||
| affected parameters. | ||
| `estimate` must be the number 0 or 1, or the string `"0"` or `"1"`; | ||
| booleans and other strings, such as `"1.0"`, are rejected. | ||
| The `estimate` column is now interpreted consistently throughout | ||
| `petab.v1`; previously, the string `"1"` was treated as not estimated by, | ||
| e.g., `get_optimization_parameters` | ||
| ([#650](https://github.com/PEtab-dev/libpetab-python/pull/650)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,6 @@ | |
|
|
||
| from ..v1.C import PREEQUILIBRATION_CONDITION_ID | ||
| from . import ( | ||
| ESTIMATE, | ||
| LAPLACE, | ||
| LIN, | ||
| LOG, | ||
|
|
@@ -37,7 +36,7 @@ | |
| Problem, | ||
| ) | ||
| from .distributions import * | ||
| from .parameters import scale, unscale | ||
| from .parameters import _is_estimated, scale, unscale | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we import it here, should we make it a public function?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's still (package)private. |
||
|
|
||
| __all__ = ["priors_to_measurements"] | ||
|
|
||
|
|
@@ -349,7 +348,7 @@ def priors_to_measurements(problem: Problem): | |
| new_problem = copy.deepcopy(problem) | ||
|
|
||
| # we only need to consider parameters that are estimated | ||
| par_df_tmp = problem.parameter_df.loc[problem.parameter_df[ESTIMATE] == 1] | ||
| par_df_tmp = problem.parameter_df.loc[_is_estimated(problem.parameter_df)] | ||
|
|
||
| if ( | ||
| OBJECTIVE_PRIOR_TYPE not in par_df_tmp | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This together with the check in line 679 could produce a misleading error when only one value is
""correct? not sure this is intended.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.
Old issue, but good catch. Fixed now.