Repository navigation
Conversation
…ments Listing an initial assignment target in the parameter table replaces the initial assignment. For a generated template, this is rarely intended if the assignment expresses a dependency (`k_derived = k_base + 1`), and the SBML `value` attribute used as nominal value is stale or `NaN`. With `include_optional=True`, `create_parameter_df` now omits targets of initial assignments that refer to model entities, function definitions, or time. Such parameters are still included if they are referenced in the measurement table (as observable or noise parameter overrides) or as values in the condition table, since these references require a parameter table entry: named measurement table overrides must be listed in the parameter table, and a condition table reference cannot be resolved from a non-closed-form initial assignment. Targets of closed-form initial assignments (e.g., `2 * 3`) are kept, with the evaluated assignment as nominal value. The closed-form check is syntactic (`a - a` is not closed-form). Closes PEtab-dev#638. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A parameter table entry for a model parameter with a non-numeric initial assignment was ignored for the model, so the initial assignment applied. Condition table and measurement table references to the same ID resolved to the parameter table entry, so one ID could have two values. Now, such entries replace the initial assignment, as for numeric initial assignments and as in PEtab v2. Model parameters with non-numeric initial assignments that are not listed in the parameter table are still not part of the mapping. This changes the mapping output for problems with such entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #643 +/- ##
==========================================
+ Coverage 80.34% 80.50% +0.15%
==========================================
Files 70 70
Lines 8505 8554 +49
Branches 1561 1577 +16
==========================================
+ Hits 6833 6886 +53
+ Misses 1180 1177 -3
+ Partials 492 491 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In PEtab v1, a parameter table entry for a model parameter with a non-numeric initial assignment (e.g.,
k_derived = k_base + 1) was ignored for the model: the initial assignment still applied. Condition table and measurement table references to the same ID, however, resolved to the parameter table entry, so one ID could have two values. This PR makes the parameter table entry replace the initial assignment, as it already did for numeric initial assignments, and as specified in PEtab v2.This changes the parameter mapping, and thus the results, for problems that list such parameters in the parameter table. Parameters with non-numeric initial assignments that are not listed in the parameter table are unaffected; their initial assignments still apply.
Changes:
get_parameter_mapping_for_conditionraises aValueErrorif precomputedsimulation_parameterslack such parameters, instead of silently ignoring their parameter table entries.create_parameter_df(..., include_optional=True): since listing a parameter replaces its initial assignment, targets of initial assignments that are not closed-form are no longer included. An initial assignment is closed-form if it refers to no model entities, function definitions, or time, and can be evaluated (e.g.,2 * 3, but notk_base + 1); this is decided syntactically. Such parameters are still included if they are referenced in the measurement table (as observable or noise parameter overrides) or as values in the condition table, since these references require a parameter table entry: named measurement table overrides must be listed in the parameter table, and a condition table reference cannot be resolved from a non-closed-form initial assignment. In these cases, the parameter table entry also replaces the initial assignment in the model. For targets of closed-form initial assignments, the nominal value is now the value of the assignment instead of the SBMLvalueattribute, which was often stale orNaN.Since parameter table entries now replace initial assignments, a non-estimated entry without
nominalValuewould putNaNinto the model. #640 makes lint reject such entries and should be merged before or together with this PR.Fixes #638. Relates to #522.
🤖 Drafted with AI assistance (Claude Code)