Lint mapping table#480
Conversation
| str_p | ||
| for p in overrides | ||
| if isinstance(p, sp.Symbol) | ||
| and (str_p := str(p)) not in condition_targets |
There was a problem hiding this comment.
Not necessary since this is collected as a set and the condition_targets are removed further down.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #480 +/- ##
==========================================
+ Coverage 75.29% 75.41% +0.11%
==========================================
Files 62 62
Lines 6946 6975 +29
Branches 1229 1240 +11
==========================================
+ Hits 5230 5260 +30
+ Misses 1245 1239 -6
- Partials 471 476 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4df4635 to
e1c3d3d
Compare
dweindl
left a comment
There was a problem hiding this comment.
Thanks. Almost there, I think.
| # Duplicates for annotation-only rows (identity mappings) | ||
| # are permitted. |
There was a problem hiding this comment.
By duplicates, you mean petab_id == model_id, not multiple rows with the same petab_id or model_id, right?
It's not super clear from the specs whether the latter would be allowed or not.
There was a problem hiding this comment.
Yes, I've reworded to comment to make this clearer.
| for mapping in problem.mappings: | ||
| if mapping.model_id and mapping.model_id in parameter_ids.keys(): | ||
| if mapping.petab_id not in invalid: | ||
| parameter_ids[mapping.petab_id] = None |
There was a problem hiding this comment.
This might add all kinds of entities to the allowed-in-parameter-table dict. Species, observables, experiments, ...
For the currently supported model types (SBML, PySB), I don't think there can be a situation where the mapping table would contribute additional values allowed in the parameter table. For a model type where this could happen, we'd need some API for accessing parameters that are allowed in the parameter table if they had proper IDs. This doesn't exist yet. So either we need to add it now, or completely ignore the mapping table in this function. (The same holds for get_required_parameters_for_parameter_table below.)
There was a problem hiding this comment.
a situation where the mapping table would contribute additional values allowed in the parameter table
SciML problems have this use case don't they? For example, we'd define net_ps as a PEtab id for the network parameters net1.parameters in the mapping table, and then also have net_ps specified in the parameters table with its bounds etc.
There was a problem hiding this comment.
Quite possible, I am not sufficiently familiar with petab-sciml. In that case, I would ignore it for now, revert the changes in get_valid_parameters_for_parameter_table, and address it after this PR and #482. It will probably require a bit more thought and changes.
There was a problem hiding this comment.
The same for get_required_parameters_for_parameter_table. As far as I can tell, with the currently (pre-sciml) supported models, the mapping table won't affect what's allowed or required in the parameter table.
There was a problem hiding this comment.
I have removed all the mapping table related changes from both functions and updated the unit test.
ef86844 to
d903f22
Compare
Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
dweindl
left a comment
There was a problem hiding this comment.
Thanks, looks good to me, except for that duplication!
Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com>
| This also ensures that the mapping table petab ids | ||
| are used in the PEtab problem.""" |
There was a problem hiding this comment.
Where does it do this? There is no ValidationError with a message like "Unused mapping table PEtab IDs: ...."
There was a problem hiding this comment.
Good point, it doesn't do this yet as I'm planning to handle mapping/parameter table interaction in the sciml branch. I've removed from the docstring.
petab.v2.lint.get_valid_parameters_for_parameter_table: add mapping tablepetabEntityIdregardless of whether the correspondingmodelEntityIdwould be valid (was L937->L1036)