Skip to content
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

Smith benchmark and SBML initialization fix #2034

Merged
merged 14 commits into from
May 5, 2023
Merged

Conversation

FFroehlich
Copy link
Member

@FFroehlich FFroehlich requested a review from a team as a code owner March 8, 2023 20:22
compartment = sbml_model.getCompartment(
sbml_model.getSpecies(assignee_id).getCompartment()
).getId()
formula = f'({formula}) / {compartment}'
Copy link
Member

Choose a reason for hiding this comment

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

Hm, somehow I thought species with hasOnlySubstanceUnits=True should have amounts here, not concentrations.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was also a bit confused, but the initial assignments processing code in amici will assume the formula yields a concentration which then needs to be converted to an amount to assign the species.

Copy link
Member

Choose a reason for hiding this comment

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

Hm, but doesn't that go against the SBML spec?

SBML L3V2 section 4.8.5:

• In the case of a species, an InitialAssignment sets the referenced species’ initial quantity (concentration or
amount) to the value determined by the formula in math. The unit associated with the value produced by
the math formula should be equal to the unit associated with the species’ quantity. (See Section 4.6.5 on
p. 51 for an explanation of how a species’ quantity is determined.)

4.6.5

The interpretation is controlled by
the attribute hasOnlySubstanceUnits. If the attribute has the value “false”, then the unit of measurement
associated with the value of the species is {unit of amount}/{unit of size} (i.e., concentration or density). If
hasOnlySubstanceUnits has the value “true”, then the value is interpreted as having a unit of amount only.

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm, that sounds like our approach to handling these assignment rules is wrong then. Suprising that the sbml testsuite passes nevertheless.

Copy link
Member

Choose a reason for hiding this comment

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

Suprising that the sbml testsuite passes nevertheless.

Indeed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Suprising that the sbml testsuite passes nevertheless.

Indeed.

okay fixed in sbml_import. Looks like not a single past fails 🤔

@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Merging #2034 (489a04e) into develop (b47ea26) will decrease coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2034      +/-   ##
===========================================
- Coverage    75.27%   75.26%   -0.01%     
===========================================
  Files           75       75              
  Lines        13017    13015       -2     
===========================================
- Hits          9798     9796       -2     
  Misses        3219     3219              
Flag Coverage Δ
cpp 72.85% <ø> (ø)
petab 53.80% <ø> (+<0.01%) ⬆️
python 69.63% <ø> (-0.02%) ⬇️
sbmlsuite ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
python/sdist/amici/sbml_import.py 76.71% <ø> (-0.06%) ⬇️

@dweindl dweindl changed the title Smith benchmark and petab initialization fix Smith benchmark and SBML initialization fix Mar 9, 2023
Copy link
Member

@dweindl dweindl left a comment

Choose a reason for hiding this comment

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

👍

tests/benchmark-models/benchmark_models.yaml Outdated Show resolved Hide resolved
@FFroehlich FFroehlich enabled auto-merge April 28, 2023 09:44
@FFroehlich FFroehlich added this pull request to the merge queue Apr 29, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 29, 2023
@FFroehlich FFroehlich added this pull request to the merge queue Apr 29, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 30, 2023
@FFroehlich FFroehlich added this pull request to the merge queue May 1, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 1, 2023
@FFroehlich FFroehlich added this pull request to the merge queue May 5, 2023
@FFroehlich FFroehlich removed this pull request from the merge queue due to a manual request May 5, 2023
@FFroehlich FFroehlich added this pull request to the merge queue May 5, 2023
@FFroehlich FFroehlich removed this pull request from the merge queue due to a manual request May 5, 2023
@FFroehlich FFroehlich merged commit b5b5cb8 into develop May 5, 2023
@FFroehlich FFroehlich deleted the smith_benchmark branch May 5, 2023 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants