Skip to content

test(bngsim): follow bngsim 0.17.0's per-species atol, and refresh the declined-model fixture - #1021

Merged
wshlavacek merged 1 commit into
mainfrom
fix/tests-follow-bngsim-017-atol
Nov 4, 2026
Merged

wshlavacek merged 1 commit into
mainfrom
fix/tests-follow-bngsim-017-atol

Conversation

@wshlavacek

Copy link
Copy Markdown
Collaborator

main's tests workflow went red when CI started installing bngsim 0.17.0. Four tests fail on the bngsim legs, and none of them is a PyBNF defect. This updates the tests and docs to bngsim 0.17.0's behaviour and leaves PyBNF passing tolerances to bngsim as written.

Supersedes #1018, which passed every atol as bngsim.ExactAtol and so bypassed bngsim 0.17.0's per-species reading.

bngsim 0.17.0 reads a scalar atol as a per-species ceiling (lanl/bngsim#1420)

Each species is held to min(atol, rtol·max(|x_i(0)|, floor)).

test_the_backend_default_atol_is_what_corrupted_those_sensitivities pinned sbml_atol to the old 1e-8 default on a species seeded at 1e-8 and expected corrupted sensitivities. On 0.17.0 the ceiling resolves them: errors of 2.3e-07, 7.6e-07 and 1.1e-06 against the closed form.

  • That test now runs only on builds that hold a scalar exactly (through 0.16.0).
  • A new test, test_a_per_species_ceiling_resolves_what_the_old_default_corrupted, asserts that the 0.17.0 reading resolves the same columns inside the 1e-4 budget.
  • Which reading a build uses is detected by whether bngsim.ExactAtol exists, since it arrived in the same release.

bngsim 0.17.0 differentiates abs/min/max of the state (lanl/bngsim#1126)

k*S*|S-Km| no longer declines the analytic sensitivity RHS. The three sensitivity-fallback tests now use k*S*floor(Km), which every build declines, and request parameter columns only. This is #1018's fixture change, taken as is.

Docs

Checked

  • On bngsim 0.16.0 and 0.17.0, with petab 0.10.0, I ran the two changed test files plus test_petab_convert.py and test_packaging_metadata.py. Each build gave 387 passed, 9 skipped. The old tolerance test runs on 0.16.0 and the new one on 0.17.0.
  • Mutation checks:
    • Making PyBNF wrap a stated atol in ExactAtol (the bypass) fails the new tolerance test.
    • Restoring the abs() fixture fails the three fallback tests.

…e declined-model fixture

Main's tests workflow went red when CI started installing bngsim 0.17.0. Four
tests fail on the bngsim legs; none of them is a PyBNF defect.

bngsim 0.17.0 reads a scalar atol as a ceiling per species,
min(atol, rtol*max(|x_i(0)|, floor)) (lanl/bngsim#1420). PyBNF keeps handing
the number over as written, so that reading is what a run gets.
test_the_backend_default_atol_is_what_corrupted_those_sensitivities pinned
sbml_atol to the old 1e-8 default on a species seeded at 1e-8 and expected the
sensitivities corrupted; on 0.17.0 the ceiling resolves them (2.3e-07, 7.6e-07,
1.1e-06 against the closed form). It now runs only where bngsim holds a scalar
exactly, through 0.16.0, and a new test asserts the 0.17.0 reading resolves the
same columns inside the 1e-4 budget the derived tolerance is held to. The
reading is probed by bngsim.ExactAtol's presence, which arrived with it.

bngsim 0.17.0 also differentiates abs/min/max of the state (lanl/bngsim#1126),
so k*S*|S-Km| no longer declines the analytic sensitivity RHS. The three
sensitivity-fallback tests take k*S*floor(Km), which every build declines, and
request parameter columns only, as #1018 worked out.

docs/config_keys.rst said a number in sbml_atol integrates every species at
that value; it now says that holds through 0.16.0 and what 0.17.0 does. Both
tolerance docs carry #1018's correction of the abs/min/max claim.

Checked on bngsim 0.16.0 and 0.17.0, petab 0.10.0: the two changed files plus
test_petab_convert.py and test_packaging_metadata.py, 387 passed, 9 skipped on
each, with the old tolerance test running on 0.16.0 and the new one on 0.17.0.
Mutations: wrapping a stated atol in ExactAtol fails the new tolerance test;
the abs() fixture fails the three fallback tests.

Supersedes #1018, which passed every atol as ExactAtol instead.
@wshlavacek
wshlavacek merged commit b6cd07f into main Nov 4, 2026
8 checks passed
@wshlavacek
wshlavacek deleted the fix/tests-follow-bngsim-017-atol branch November 4, 2026 19:24
wshlavacek added a commit that referenced this pull request Nov 4, 2026
Bump __version__ 1.8.1 -> 1.8.2, with CITATION.cff and docs/conf.py, and fold
the 108 staged fragments into CHANGELOG.md's [v1.8.2] section: 12 added, 10
changed, 1 removed, 85 fixed.

Raise the bngsim floor from 0.16.0 to 0.17.0 (pyproject dependencies, the
antimony extra, and the CI install in setup-pybnf), released together with this
version. The fixes the test suite credits to bngsim main rather than to 0.16.0
are all in a released build from 0.17.0 on, so an install resolved from PyPI
gets the answers those tests assert. The gradient fit's run-time gate still
names 0.16.0, the oldest build that code is right on. The two packaging tests
that pin the floor string follow it.

Built on main after #1017 (petab 0.10) and #1021 (bngsim 0.17.0's per-species
atol), which turned main's tests workflow green again.

Checked against bngsim 0.17.0 and petab 0.10.0 from PyPI:
test_packaging_metadata.py, test_sbml_solver_tolerances.py,
test_gradient_sens_fallback.py and test_petab_convert.py, 387 passed, 9
skipped; uv build and twine check --strict pass, and the wheel declares
Requires-Python >=3.12 and bngsim<1,>=0.17.0.
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.

1 participant