Skip to content

bngsim 0.17.3

Choose a tag to compare

@github-actions github-actions released this 23 Nov 07:31
· 721 commits to main since this release
5a303be
pip install bngsim==0.17.3

Full changelog for 0.17.3


Added

  • Result.rerun(linear_solver=...) and check("linear_solver") (#1888). rerun() takes an ODE run's linear solver, "dense", "klu" or "auto", through the Simulator's force_dense_linear_solver and force_sparse_linear_solver, so a run that fails on KLU can be made again dense with one call. check("all") adds linear_solver: the run on the other solver (dense for a KLU run, KLU for a dense one), judged species by species like the other paths, or skip with the reason where KLU cannot run the model (a build without KLU, no sparse Jacobian pattern, a JAX Jacobian).

  • Result.digest(sensitivities=True) (#1883). For each listed column, the digest now says which parameters and initial amounts move it most at the last time: up to max_parameters (default 5), ranked by |p·dY/dp| so a parameter's units do not decide the order, each with its raw derivative, p·dY/dp, and the scaled sensitivity (p/y)·dY/dp (None where y is within its tolerance of 0). A parameter at 0 or of no recorded value is listed apart, a non-finite derivative is counted, and a one-sided column carries its side.

  • Notice codes are listed with what to do about each (#1858). The error-code reference page, now "Error and notice codes", has a table of every code a run's notice can carry, with its meaning and an action, generated from the same source as the notices themselves.

  • A run that fails keeps its notices on the error (#1857). A BngsimError raised by a run now carries the notices the run had collected, as e.notices and in e.to_dict(): that it started from the last run's end state, say, or retried on a difference-quotient Jacobian. A warnings filter or logging level does not drop them. An error raised from a run's error carries that run's notices too, and a sensitivity chunk that fails and is retried column by column passes what it noted on to the result.

  • Model.describe() says whether a steady state can be solved for (#1844). methods["steady_state"] is refused for a model with an event, a compartment size that jumps, a state the time reaches, one the ODE Simulator refuses, or one with no species, listing every reason with the message steady_state() raises for the first; steady_state() and steady_state_batch() now raise from the same check. Otherwise ok, with a note that the call still checks the model's conservation laws and that a solve can fail to converge.

  • What a model is, asked by another tool's name, now names describe() (#1843). model.summary(), .info(), .to_dict(), .compartments, .reactions, .units and their neighbours raised a bare AttributeError, as did libRoadRunner's getInfo, getCompartmentIds, getReactionIds and getNumReactions on a Model or a Simulator. Each now names the call to make: model.describe(), or the part of it that holds the answer, with every entry (limit=None); getNumReactions the file's count, as RoadRunner gives it. The agent guide's translation table lists the libRoadRunner ones.

  • The test suite now validates the SED-ML bngsim writes against the SED-ML L1V3 schema (#1734). #1677's schema failure, in every archive net_to_omex(bngl=...) made, was found by hand with xmllint. test_sedml_schema.py checks write_sedml, the net2sbml --sidecar output, write_sedml_protocol over the repository's .bngl corpus, and the SED-ML in archives of each shape the writer has, with lxml.etree.XMLSchema against a vendored copy of the schema in tests/data/sedml_schema. lxml joins the test extra. It found one: a min or max, which SED-ML L1V3's MathML does not have, in an action's expression or a derived parameter said again as the model runs. Each is now written as a piecewise, and read_sedml_protocol reads a piecewise as BNGL's if, which a replay evaluates; it refused piecewise(...).

  • A bngsim command, also python -m bngsim (#1708). bngsim doctor says what this install can do, what is missing and the fix for each, with the Python, the platform and the C compiler codegen would use; bngsim examples lists the bundled models and their files; bngsim inspect MODEL prints Model.describe(); bngsim guide and bngsim skill print the agent guide as before. The converters and the cache tool are also bngsim convert TOOL ... and bngsim cache ..., unchanged. With --json a command prints exactly one JSON object on standard output, and anything else written there, by Python or by C, goes to standard error; an error is the BngsimError.to_dict() object on standard error. Exit codes are distinct: 0 success, 1 error, 2 usage error, 3 refusal, and 4 and 5 kept for a failed run and a timeout. run and check are to come.

  • bngsim run MODEL and bngsim check MODEL (issue #1708, part 2). run makes one run from the model's initial state and prints the run's record and Result.digest(), never the arrays: --out writes those to .npz, .csv or .h5. check makes the same run, then Result.check(), and exits 6 when the check is not ok, with the report on standard output. Both take the method, the time window or sample times, --set NAME=VALUE, a seed and the tolerances; run --replicates N digests a stack of stochastic runs. Every run has a wall-clock limit, --timeout (600 s by default; exit 5 past it). A .bngl file needs --network, so the caller says it means one run of the generated network and not the file's own actions.

  • Result.check(): the run made again with one setting changed, and whether the answer moved (issue #1707). Each check is a rerun() from the run's own start on a fresh model, so the session is untouched. By default an ODE run is checked at a tenth of its tolerances and at 8x the output points; check("all") adds a difference-quotient Jacobian, compiled against interpreted code, and libRoadRunner where it is installed. A stochastic run is made again at 10 other seeds, with each observable's mean and standard error. Each species is judged on its own scale, past the atol the run applied to it, so a small species is not hidden by a large one; a path may not differ by more than 1% of a species' peak for the tolerance alone. A disagreement is reported with what to do next, not raised; budget= bounds the wall time.

  • Example models with exact solutions, and bngsim.ModelBuilder for building a model in Python (#1706). bngsim.examples has six small models that ship with BNGsim: binding (A + B <-> C), decay, chain, birth_death, bolus (an event), and schlogl (a bistable switch). Each comes with its exact solution, bngsim.examples.exact(name, t) or steady_states(name), so you can try BNGsim with no model file and check its answers. binding comes in every format: .net, BNGL, BNG-XML (for NFsim and RuleMonkey), SBML, Antimony, and Python. bngsim.ModelBuilder builds a model in Python: add parameters, species, reactions, observables, functions, and events, then build() returns a Model. The events guide's example used the internal builder and did not run; it now uses ModelBuilder.

  • Model.from_biomodels loads a BioModels entry by its id (#1706). bngsim.Model.from_biomodels("BIOMD0000000010") asks BioModels for the entry's main SBML file, checks it against the sha256 BioModels publishes, and keeps a copy in ~/.cache/bngsim/biomodels (or $BNGSIM_BIOMODELS_CACHE_DIR), so the next call needs no network. Pass version= to pin a version, or refresh=True to fetch the latest again. model.describe()["source"] records the id, version, file name, and sha256. With no network and no cached copy, the error says so and names the cache directory. Model.load("BIOMD0000000010") used to read the id as a file with no suffix; it now says to call Model.from_biomodels.

  • Model.describe(): what a model is, in one call (#1705). repr(model) gave four counts, and what kind of quantity a species holds, its compartment, the file's reactions and which methods the model admits could not be read; a refused stochastic or network-free run was found by running it. describe() returns a JSON-serializable dict whose str() is a plain-text report: where the model came from (format, path, SHA-256), counts, parameters, compartments, species with their initial value, compartment and quantity (SBML and Antimony; absent for .net and BNGL), the file's reactions as written, events, what reads the clock, where the next run starts, and for ode, ssa, psa, nf, rm and forward sensitivities, a status and the reasons each is refused, read from the checks the Simulator makes. Lists past limit= (default 50) are cut and say how many they left out.

  • Result.digest(): what a result's values did, for a caller that cannot look at a plot (issue #1704). A JSON-ready dict, bounded in size, whose str() is a line per column: first and last values, extremes and their times, turns, whether the column has settled by the end of the window, and flags for a non-finite, negative or never-moving column. Turns and "settled" are judged by the steady-state code's criterion="scaled" tolerance at the run's own rtol and atol, so an integrator's wobble is no turn. A single stochastic run gets its values alone; a stack, statistics across runs at the last time. Past max_columns (20) it lists the widest ranges and counts the rest. Result.save("run.npz") writes the arrays, names and record with NumPy alone; a .csv or .tsv path is refused, naming to_csv.

  • A Result says what its numbers are and how its run went (#1703). Result.record, a JSON-serializable dict that summary() and save() carry, gives each column's quantity (concentration, amount or count), compartment, size and SBML units; the method, times, start state and parameters; the tolerances as the solver was given them; which code ran, including an analytical Jacobian retried on a difference quotient; the model file's hash; and the build. Result.notices lists every warning of the run, whatever the warning filters or logging level let through.

  • A Result can make its run again: Result.rerun() (#1703). It builds the model from the recorded file, once its sha256 still matches, or from the text a string load kept, gives it the parameters, start state and event state the run started from, and runs at the recorded method, seed, times, tolerances as applied, Jacobian, linear solver and right-hand side: an ODE run comes back bit for bit, a stochastic one too on the same build. The model the run used is neither read nor changed. rerun(rtol=1e-10) changes one setting and keeps the rest, and the new record's run.rerun_of says what was repeated and changed. Where the record cannot promise the same run (a stack, a network-free run, stop conditions, carried sensitivities, an edited model, a file or table data changed on disk) it refuses with a rerun.* code. A string-loaded model keeps its text, which save() writes into the file. The record gains keys for what a rerun reads.

  • Every BNGsim error carries a stable code, its details and remedies a program can act on (#1702). A tool or an agent can branch on e.code instead of matching the message, which changes between releases. e.details says what the error is about (the name and its close matches, the path, the constructs, the solver flag), e.remedies lists fixes as dicts with a kind (such as install_package with its pip install command), e.docs_url points at a new error-code reference page, and e.to_dict() gives all of it as plain data. An error with no code of its own carries its class's generic one. A missing optional package is now bngsim.DependencyError, a missing file bngsim.MissingFileError and a missing xml_path= bngsim.UsageError; each is still the ImportError, FileNotFoundError or ValueError it was. Messages are unchanged.

  • A second run() continued the first run's end state with its clock set back, and its Result said nothing of it (#1701). A -> B run twice over (0, 5) from A = 10 gave A(0) = 10, then 0.0674. The behaviour stays, as BNG2.pl's has it, and is now recorded and checked:

    • Result.started_from ("initial" or "live") and Result.start_state_sha256, also in summary(), save() and to_xarray().
    • A bngsim.LiveStartWarning before a call starts from exactly the state the last run left, before the time it ended at: run(), run_until (by its clock), run_replicates, parameter_scan, bifurcate, and run_protocol's first run.
    • run(start="initial") resets the model first, undone if the run raises; run(start="live") continues without the warning.
  • An agent guide in the wheel, and an llms.txt index of the documentation (#1699). bngsim.agent_guide() returns one page for the installed version, with no network: the calls, eight rules that otherwise give wrong answers, what a refusal means, what each feature needs, a translation table from libRoadRunner, Tellurium, AMICI, COPASI, BioNetGen and PySB (generated from the table the wrong-name errors read), how to check a result and how to report a bug. python -m bngsim guide prints it and python -m bngsim skill prints it as a SKILL.md file. The documentation includes the same file, and its build writes llms.txt, llms-full.txt and each page's Markdown, which Read the Docs serves at bngsim.readthedocs.io/llms.txt. A test runs every block of the guide and holds it to a 32,000-character budget. The module docstring, which pointed to a README the wheel does not hold, now points to the guide.

  • Wheels for CPython 3.14 and 3.15 (#1491). pip install bngsim on either version took the sdist and built from source, needing a C++ toolchain and CMake, and SuiteSparse for the KLU solver. The wheel matrix now covers cp314 and cp315 on Linux x86_64, macOS arm64 and x86_64, and Windows x86_64, and the classifiers, the installation page, the support matrix and scripts/local_ci.py matrix say so. pypa/cibuildwheel moves from v4.1.0 to v4.3.5, which builds 3.15 by default against a final release, 3.15.2. Linux aarch64 gets wheels too, cp310–cp315 built on a native ubuntu-24.04-arm runner, where pip install bngsim on Linux/ARM (Docker on Apple Silicon, ARM cloud and cluster nodes) built from source; the antimony extra still has no wheel there. Free-threaded builds (cp314t, cp315t) are not included.

Changed

  • Result.check() judges every species, and reads a run's scatter at its tolerance (#1887). A species within 100 atols of zero, or not converged at the run's tolerance, was left out of every path check, so a rerun on which it departed from zero, or went non-finite, passed; each is now held to the run's whole scale and its own scatter. A path's allowance reads a species' drift as the larger of its move at a tenfold tighter tolerance and half its move at twice the tolerance: one tighter run understated a correct run's scatter where the run's own error was small by luck, and a correct path read as a disagreement. check() makes one more rerun for it. Where an event or a rule promotes a parameter into the state, each species now takes its own atol, matched by name, not the scalar ceiling. The developer-side differential harness, paths and steady states alike, judges by the same rule, species by species, where it judged the whole trajectory against the largest species' peak.

  • The user guides, the quickstart and the agent guide are rewritten in plain English (#1846). Each guide opens with the common case: the call, a short example and what to watch out for, with details further down. The guides are much shorter, and they no longer cite issue numbers; a test keeps them out. The agent guide's title is now "BNGsim agent guide", and its translation table and the wrong-name errors it is generated from call the tool BNGsim.

  • A pull request that adds a test file no check runs now gets a warning (#1764). mir.yml and the three Windows workflows run hand-picked test lists, and the python-tests legs build without what they have (MIR, MSVC, KLU on Windows), so a new file that only does real work there skipped on every leg, ran nowhere else, and left every check green. A new python-tests job, "New test files run somewhere" (ci/new_test_coverage.py), reads every leg's per-file counts and every other workflow's pytest commands and pull_request trigger. It warns, naming the file, when the pull request adds a test file that skipped on every leg and that no workflow running on that pull request runs, and says which lists and paths filters it could join. A workflow counts only when its paths filter fires for the change, so forced-jit (whole suite, nightly) counts only when the change edits its files; an argument it cannot read (a shell array, a matrix value, -k) never counts, so neither does sanitizers. It warns rather than fails, as does a missing or unreadable report.

  • A pull request that adds tests no longer has to raise a count in ci/test_floors.env (#1757). The Python suite counts job now holds each test file's collected and skipped counts, for python/tests and parity_checks/tests, to the same leg's counts on main (ci/test_file_counts.py): a file the change does not touch may not lose a test, and untouched files may not gain more than 10 skips. A deliberate loss is accepted with the drops tests pull request label. The four bounds this replaces, and the merge conflicts two pull requests adding tests at once had over them, are gone.

  • Every error BNGsim raises about a model, a run or an argument now has a code (#1702). The ones raised as built-in ValueError, TypeError, KeyError, NotImplementedError or RuntimeError are now BNGsim errors that are still those built-ins: UsageError, the new ArgumentTypeError, NotFoundError, NotSupportedError, InvalidModelError and CodegenBuildError, each with a code a program can branch on. Messages are unchanged, but for the class name a few quote of the error behind them (a failed codegen build is now CodegenBuildError there, not RuntimeError). One behavior change: every BNGsim error is a RuntimeError, so an except RuntimeError now also catches an argument error that used to be a plain ValueError. A CVODE failure's code now comes from the engine as data rather than from the message, and so does a missing compiler's.

  • The PyPI summary, the module docstring, the docs front page, and llms.txt now say that bngsim simulates SBML, Antimony, and BNGL models (#1698). They used to call bngsim a simulation engine for BioNetGen reaction networks. The package now has keywords. The README is shorter and links to two new docs pages: "When to use bngsim", a table of tasks and alternatives with tips on compilers, solvers, sensitivities, steady states, SSA vs. PSA, NFsim and RuleMonkey, and JAX; and "What bngsim does", the feature list that was in the README. The quickstart no longer says that PSA preserves Gillespie statistics. PSA preserves means, not variances.

  • Re-runs of models with events, time switches or state switches cost less (#1669). CVODE's root function evaluated every model function at every call, after every step and at every output row, though most triggers read the clock alone; it now evaluates only the observables and functions its expressions read. A state switch's residual, written out with every rule it reads, now computes each repeated subexpression and call once: BIOMD0000000385's ten residuals were 64,746 nodes of 183 different ones. A re-run of BIOMD0000000385 takes 19 ms where it took 117 ms (libRoadRunner: 4.8 ms), BIOMD0000000386 10 ms where it took 21 ms, and most of the other BioModels #1669 lists 10-30% less. Results are unchanged to the bit on the 1,271 rr_parity models that run, at two tolerances, and on the 1,113 that run with forward sensitivities; a shared residual can round a few units in the last place differently, which moved a run of a deep chain of rules under abs() by 5e-12 relative at rtol 1e-9.

  • Result.check() names the roadrunner extra. Where libRoadRunner is not installed, the second_engine check now says pip install 'bngsim[roadrunner]' rather than pip install libroadrunner, and the installation page lists the extra. The extra, already published, was described as developer-only; it is the supported way to get the independent engine check("all") compares an SBML or Antimony run with.

Fixed

  • run_protocol: after resetParameters, a parameter a setParameter set to an expression could follow the network's own expression instead, and a derived parameter that read it stayed a number (#1876). Writing back the parameter's saved number re-attaches it to the network's expression where the two agree before what that one reads is back. With k3 k2*3 and k4 k3*2, setParameter("k3","k1*9") saved, then k2, k3 and k4 changed and reset, k4 stayed at 18 after setParameter("k1",2), where BNG2.pl gives 36. The reset now has such a parameter follow its own expression again before it re-attaches the derived ones. A setParameter whose expression does not evaluate only while what it reads is on its way back (sqrt(d), d briefly negative) is no longer refused, after a reset or otherwise.

  • The "New test files run somewhere" check read all of a workflow's pytest commands as one, and a shell glob that expands to a directory as no directory (#1874). One step's --ignore or --deselect was applied to a file another step runs, so a file run in a step of its own was warned about; each command is now read on its own, and a file counts as run when any command runs it. A glob such as python/tests/su? is now the directory bash expands it to, which pytest walks: the files under it count as run, and an --ignore below it applies to a file also named under it, which the check had counted as run; an --ignore argument the shell expands is read the same way. No workflow on main has either shape, and the six that run pytest read the same as before.

  • run_protocol could leave a derived parameter a number after resetParameters, in some runs and not in others (#1870). The reset re-attaches each derived parameter a setParameter overrode since the save by writing back its saved value, which works only once the parameters it reads are back. They were written in the order of a set, so one written before a parameter it reads stayed a number and stopped following; the order follows the string hash seed. With k2 k1*0.5 and k3 k2*2 both overridden, then reset, setParameter("k1",3) left k3 at 1 under PYTHONHASHSEED 0 and moved it to 3 under 1: Ctot(0.5) was 12.3121 or 29.1667, where BNG2.pl gives 29.1667. The saved values are now written back twice, in the model's order: after the first every value is back, so at the second each expression gives its own.

  • The "New test files run somewhere" check read a test file named on pytest's command line as never left out by --ignore or --ignore-glob, though pytest 9 leaves it out when a directory holding it is named too (#1869). pytest 9 drops a collection argument that lies under another one, so the ignore applies to it, and the check counted such a file as run. It now walks the outermost named directory that holds a file, however it is written (./python/tests, python, .), and applies the ignores below it, unless --keep-duplicates is given. A --deselect is read as a prefix of the node ids, as pytest reads it, a shell glob's expansion and a trailing :: included; an --ignore or --deselect glob after = leaves nothing out, quoted or not; and a literal @@quoted: word no longer raises.

  • run_protocol let a held derived parameter follow a write again where it read another held parameter (#1865). Since #1738, a derived parameter that a setParameter sets to the number its expression gives is held at that number through later writes. With k2 k1*0.5 and k3 k2/k1 both set so, setParameter("k1",3) moved k2, which was written back, and that write moved k3 to 0.5/3, which was not: Ctot(0.5) was 2.6008 where BNG2.pl gives 7.4306. The hold now repeats until no held parameter has moved.

  • The "New test files run somewhere" check no longer counts a new file as run where a later change to it would run it nowhere, and no longer drops a quoted pytest pattern (#1861). A file added to mir.yml's pytest list but not to its paths filter counted as run, though a later change to the file alone fires no workflow that runs it; it is now warned about, and mir.yml and windows-tail.yml gain the three test files each ran outside its own filter. A quoted --ignore-glob pattern or --deselect node id is kept as the option's argument, --ignore-glob is matched with fnmatch as pytest matches it, directories included, and a quoted node id selects its file. A paths filter with ?, + or [ is not evaluated, since GitHub reads those differently from bash, and a git diff that fails is a warning rather than a red job.

  • Model.compartment_size_params said a forward-sensitivity column for a compartment size is refused; it is computed (#1845). The d/dV column matches a central difference across models rebuilt at V ± h. What is refused is the column of a size set_param cannot write, which describe()'s refused_parameters now names, with the parameters a rule or function sets, beside those folded at load; it named only those. The loading guide also no longer says that min, max, abs and comparisons stop a sensitivity run.

  • Forward sensitivity refused a model whose switch times coincide because a parameter is on its bound (#1822). With sigma = t0 + t_delta and t_delta = 0, the crossings at t0 and sigma share an instant and t0 has no parameter that moves it alone: bngsim raised SensitivityUnsupportedError, and a bounded optimizer that had clamped t_delta to 0 stopped there. One such crossing per instant is now given what is left of the instant's jump once the others are separated. Where a rate law composes the two crossings (U()*Lambda()), the solution has a kink in t_delta at 0 and its column is the derivative for t_delta increasing, the feasible direction at the bound: the new bngsim.OneSidedSensitivityWarning names the parameter and the direction, and Result.one_sided_sensitivities lists them. Still refused: two crossings of one instant with no parameter of their own (t_delta = t_delta2 = 0), two composed crossings that each have one (#951), such a pair on two clocks or apart by more than half the clock nudge, and one in a model with a power singular at its switch.

  • method="nfsim" froze, with no error, when a function rate law divided by an observable a firing empties for a moment (#1818). NFsim read rate laws while a firing had its molecules out of the observables: with one X, kgap*(1+9*Xp/Xtot) was 0/0 there, the NaN stayed in NFsim's running total, and every later row repeated the state at the first X firing, though each state the model reaches is finite. The vendored NFsim now carries the upstream fix (RuleWorld/nfsim#117), and the model agrees with ssa on its network. A NaN that is the model's own (B -> 0 at sqrt(k), k = -1, #1788, or a rate dividing by a count that reaches 0) is now refused by NfsimSession.simulate, step_to and the one-shot run, naming the reactions, where it was returned as a frozen run. Found after a step, the session refuses to advance until initialize(), as it now does after any error raised inside a step, which leaves a firing partway done; found before any step, it is left as it was.

  • A derived initial condition's sensitivity seed read rint, mod and frac as numpy does, not as the engine does, so its column was wrong from t = 0 with no error (#1800). X0 = rint(p)*k at p = 2.5 seeded dX/dk = 2 for 3: numpy's rint rounds a half to even, its mod is floored, and sympy's frac is x - floor(x), where the engine's are floor(x + 0.5), fmod and x - trunc(x). The seed now reads them, and the % operator, as the engine does, as the compiled and JAX right-hand sides already did. So does a derived parameter's value where a crossing reads it (frac read wrong there; rint and mod did not evaluate, so the crossing was refused).

  • sbml_to_net wrote a .net that BioNetGen's run_network refused, where an assignment rule read one listed after it (#1791). The functions block followed the SBML's rule order, and run_network reads it top to bottom: y := 3*x before x := k/2 stopped it with "Could not find variable 'x'", and BIOMD0000000268 has five such rules. bngsim sorts functions when it loads a .net, so its own reload, and the converter's validate gate, read the file fine. Each function is now written after the functions it reads; a block already in order is written as it was. Of the 1291 files main and this write from the corpus (1323 BioModels and the test models), 77 had such a read, and the other 1214 come out byte-identical. Functions that read each other, or themselves, have no order: each such group is kept together, with a ConversionWarning. The same holds for bngsim.convert.write_net, which sbml_to_net writes through.

  • A sensitivity run of a switch the clock carries across against the state stalled or came back wrong (#1776). A narrow pulse in 3*time() - Tobs, with Tobs rising at 2 per unit time, failed with "CVODE made no progress" at every tolerance. The same crossing as a jump, if(3*time() - Tobs > c, kx, 0), ran to the timeout, and with 0.1*Tobs it returned its clock-rate column 100% off with no error. Plain runs were right. The restart past such a crossing now moves the species onto the far side, each by a flow-weighted share and at most 16 times what the restart already moves it; the stall carry (#1229) takes such crossings too; and the clock-rate column no longer counts the clock's share twice. These pulses are now within 6e-6 of the closed form at rtol 1e-11. Plain runs are unchanged. Where the clock outruns the species beyond that bound, as in 3*time() - 0.05*Tobs, runs still stall or are wrong; see issue #1779.

  • On Debian-based slim images Model.from_bngl failed with Perl's "Can't locate FindBin.pm", and BNGL loading was reported available (#1761). The perl there is perl-base, without the core library that BNG2.pl's line 34 (use FindBin) and its Perl2 modules load, and the check for a usable BioNetGen asked only whether some perl was on PATH. It now asks that perl to compile the BNG2.pl it found (perl -c; a success is remembered per perl, script and library environment, and a refusal is checked again on the next resolution), so HAS_BNGL, capabilities()["missing"]["bngl"] and from_bngl's refusal agree and say the same thing: which module Perl could not find, in Perl's own words, and the fix. For a module of Perl's own that is apt-get install perl; for one of BioNetGen's own, it is $BNGPATH or $BioNetGenRoot, which point BNG2.pl at another library. A found BNG2.pl with no perl at all is reported as before.

  • On a slim container image, every SBML and Antimony load failed with a bare ImportError: libexpat.so.1 (#1760). python-libsbml's Linux wheel reads the system expat library, which images such as python:3.13-slim do not ship, so import libsbml fails inside the package while import bngsim and .net models work, and capabilities() still reported SBML as available, since HAS_LIBSBML only looked the package up. The loader's import now raises a message that says python-libsbml is installed but its compiled module did not load, quotes the cause, and names the fix, apt-get install libexpat1, keeping the exception's kind and name; Model.from_sbml and Model.from_antimony_string now name the cause and the fix too. bngsim.HAS_LIBSBML and capabilities() try the import, lazily like HAS_BNGL, so they read False there with the same text; the flag is probed when read, so assigning it no longer changes capabilities(). An antimony that is installed but cannot load is relayed with its cause instead of the extra's install hint. The installation page says what slim images need.

  • A protocol given numpy values could not be written, and was written or run wrong in three other ways (#1750). A step may hold a seed from rng.integers(), an n_points or a sweep from np.linspace. run_protocol ran it, but ProtocolSpec.to_json and write_sedml_protocol raised TypeError: Object of type int64 is not JSON serializable (float32 values and numpy bools did too). write_bngl_protocol wrote an int64 seed as the string seed=>"42" and a numpy bool as "True" or "False", both true to Perl. A scan's float32 bounds made float32 points in the run. A StateChange, an Experiment and a ProtocolSpec now hold the Python value a numpy value holds, as EvaluationSpec holds its seed, so each equals, writes and runs as the same protocol with Python numbers. An array given for a tuple field is held as a tuple. And an integer seed above 253, numpy or not, now goes through the actions block exactly: write_bngl_protocol wrote 264 - 1 as 2**64, out of a seed's range, and parse_bngl_protocol read it so.

  • An ODE sensitivity run from a state an SSA or PSA run left seeded dx(0)/dθ = 0 with no error, where one from a state an ODE run left is refused (#1749). Only the CVODE write-backs set GH #210's carried-over mark. A stochastic run now sets it too, and the mark issue #1528 reads for sensitivity_ic, and drops any seed an earlier sensitivity run left, which carry_sensitivities=True would otherwise have read for a state the stochastic run had moved on from. So each such run is now refused, as after an ODE run. The refusal says how to take the state as fixed data, with dx(0)/dθ = 0: set_state() the run's last result row after a reset() to a baseline no run advanced, or on a fresh Model once an advanced state has been saved as the baseline; the carry_sensitivities=True refusal names the stochastic run that dropped the seed. As after an ODE run, set_param() of an initial-condition parameter no longer re-doses a species in the state an SSA or PSA run left, and steady_state(sensitivity_params=...) of one that sets a conservation law's total is refused there.

  • net_to_sbml and net_to_omex refused a derived parameter that uses _pi() or _e(), and wrote a symbol named like a MathML constant, or like time, as that constant (#1741). BNG2.pl writes k2 _pi()*k1 into the .net; the call's () was left on pi's placeholder, and _e was not translated. Both are now <pi/> and <exponentiale/>, bare or called, in the SBML and in a SED-ML action's value. write_bngl had the same fault (3.141592653589793()*k1, and a bare _e, which BNG2.pl refuses) and now writes each as its number. A parameter, observable or function named exponentiale, avogadro, true, false, inf, infinity, nan, notanumber or time (any case) was read as that constant, or as the clock, wherever an expression referred to it, with no warning: the tracked tests/data/exprtk_reserved_words.net (issue #18), whose parameters true and false are 0, converted with its rate at 2 instead of 1. Such a symbol is now written as a reference to itself, as pi already was; the call time() is still the clock. The refusal of _pi(2) now names _pi, not an internal placeholder.

  • net_to_omex refused BNG2.pl's own network after an addConcentration before generate_network to a seed that a later setParameter changes (#1740). The check that a .net is the network its .bngl generates (#1683) read every seed at the parameters' final values. BNG2.pl's addConcentration reads the seed when it runs and makes the species a number, which a later setParameter does not move. So seed B() B0 (B0 = 10), addConcentration("B()",60) and setParameter("B0",20) give B = 70 in BNG2.pl's .net, where the check wanted 80. The actions are now replayed in order, each with the parameters of its moment. A parameter a setParameter writes is read, before that step, as the .bngl declares it: a number, or an expression (B0 10*k1) that follows what it reads. An addConcentration after a setConcentration to an expression adds to the seed, as BNG2.pl does. A compartment volume a setParameter changes before generation does not stop the check. A seed, and a setConcentration to an expression, still follow their parameters to generation, as BNG2.pl keeps them. A .net a run rewrote is still refused.

  • read_sedml_protocol, reading a document's standard elements, dropped, repeated or reordered runs where chains shared their first runs (#1739). write_sedml_protocol writes a run that continues earlier ones as a chain that replays them, and the reader dropped every task whose steps were the start of another's. So simulate; simulate; resetConcentrations(); simulate read back two runs of three; a scan, saveConcentrations(), a run, resetConcentrations(), setConcentration and a run read back the scan twice; and a run continuing a saved state after an unrelated run read back before it (t_end 2, 1, 3 for 1, 2, 3). None was reported lossy. Each task is now read once, in order, from where the tasks before it left the model, from a state they reached earlier (saved there, with saveConcentrations and saveParameters under a label of its own), or from the initial state, and replays to the bit what the annotation's protocol runs. A chain another tool wrote continues the longest start of it already run, and a task or chain that starts a chain already run is not run again, wherever the document lists it.

  • run_protocol kept a derived parameter following what it reads after a setParameter set it to the number it already had (#1738). BNG2.pl's setParameter replaces the network's expression with the number, whatever the number. With k2 k1*0.5 declared, setParameter("k2",0.5) then setParameter("k1",3) ran k2 = 1.5 where BNG2.pl runs 0.5: A(0.25) = 54.977 against BNG2.pl's 50.017. The same happened after a scan or a bifurcate of k2 that ended on that number, and in a scan of k1 after setParameter("k2",3) at k2 k1*3. set_param overrides a derived parameter only while the value differs from its expression's (#188), so the replay now holds such a parameter at its number through every later write, and a saveParameters and resetParameters keep it so. A parameter held so reads nothing, so a later setParameter("k1","k2*2") is no longer refused as defined through itself. The hold is the replay's: on the model run_protocol returns, set_param follows its own rule (#188), and a k2 that holds the number its expression gives follows k1 again. The issue's two protocols now give BNG2.pl's numbers.

  • A SED-ML change that set a species from a parameter followed that parameter, so a scan of it moved the species, with no warning (#1737). SED-ML evaluates a computeChange's or setValue's math once, where it applies, as read_sedml_protocol already read a parameter's (#1682), but a species' was kept as a live expression until the next run. A model change A = A0*2 and a resetting scan of A0 over 10, 20, 30 replayed A(1) = 11.35, 22.71, 34.06 where the document gives 113.53 at each point. The change is now read as evaluated once, and run_protocol applies it so. A setValue in the sweep that reads the sweep's own range still follows it (#1733), and a BNGL block written from the protocol (write_bngl_protocol, or write_bngl with a protocol) now warns where BNG2.pl runs it from another amount: where a run starts from the setConcentration's expression, which BNG2.pl keeps until a run and a reset to a save of it brings back (a resetting scan's, at each point), after a parameter it reads was changed or scanned, and where an addConcentration finds the expression and adds to the declared amount.

  • net_to_omex's SED-ML left a value the SBML computes by an initialAssignment where the simulator computed it on loading, when a parameter it reads was set as the model ran (#1733). A scan of k1 beside a derived k2 = k1*3 gave A(1) = 75.46, 50.12, 37.52 on libRoadRunner for BNG2.pl's 75.46, 75.00, 75.00, and a dose scan of A0, with the seed A() A0, was flat at 56.77. Each such setValue is now followed by one of what the assignment computes, and a seed follows its parameter until a run; so does a species set to an expression, setConcentration("A()","A0*2"). The changes before a run are written in the order the actions made them, each after what it reads: setParameter("kr","k2*2") after setParameter("k1",5) ran kr = 6 for 30, and an addConcentration to a seed added to the amount the SBML holds. The sedml_lossy note goes, except for an assignment SED-ML math cannot say (an SBML function, or time). read_sedml_protocol, given the SBML, reads these setValues beside a scan as the model's seed or expression, not as a loss. A chain now starts with its first run's own task, on that task's model, read once.

  • Model.load on BioNetGen's XML, the file NFsim and RuleMonkey read, gave an empty model with no error (#1712). Its <sbml> root is in http://www.sbml.org/sbml/level3, which is no SBML namespace, and the elements in its <model> are not SBML's: libSBML reports error 20101 and reads the <model> element but nothing inside it, so bngsim built Model(species=0, reactions=0, observables=0, parameters=0), which ran and returned nothing. Model.load, Model.from_sbml and Model.from_sbml_string now refuse an empty model that is BioNetGen's XML (told by <ListOfMoleculeTypes> or <ListOfReactionRules>) or whose root is in no SBML namespace. BioNetGen's XML is named, with the routes this build has that run it: NfsimSession or RuleMonkeySession on the file, or xml_path= beside the model from its .net. SBML with a missing or slightly wrong root namespace, whose model libSBML reads whole, loads as before. Of 4,359 XML files in the repository and the BioModels corpus, the 125 refused are all BioNetGen XML.

  • The calls a caller brings from libRoadRunner, Tellurium, SciPy or BioNetGen name bngsim's call (#1700). Model(path) and Simulator(path) failed inside bngsim ('str' object has no attribute 'param_names'); they now say to use Model.load(path). sim.simulate, sim.reset, bngsim.load, Model.from_file, result.to_dataframe() and other foreign names, and run(0, 10, 11), run(t_end=10), run(n_steps=10) and run(times=[...]) (and t_end=, n_steps= and the like in run_batch, run_replicates, parameter_scan, bifurcate, compute_all_sensitivities and run_until), raise the error Python raised, now naming the call to make. None is an alias: BioNetGen's n_steps=10 is n_points=11. ParameterError lists close names, and says when a name is a species or an observable. result.species["A"] is species A's column, as result.observables["A"] is. The table is bngsim._foreign_names.FOREIGN_NAMES.

  • On an install with no BioNetGen, Model.from_bngl's error and capabilities()["missing"]["bngl"] ended with advice for bngsim's own developers (#1692). The closing sentence about the parity_checks/ suite and uv sync --extra dev --group parity meant nothing to a user of the wheel. Both messages now end at the fix that applies to them: pip install 'bngsim[bngl]', or point $BNGPATH at a BioNetGen folder. Contributors still get the --group parity advice: from the parity_checks/ entrypoints when they abort, and from the test suites' skip summaries.

  • The first example on the docs index and the quickstart could not be run as written after pip install bngsim (#1691). Each loaded a model.net the reader did not have; the README's had been fixed already (#1698). Both pages now write the README's two-species network to model.net before loading it, run it to t = 10 and print the closed-form check, so the three front-door examples agree and run in an empty directory. The docs test that executes them no longer supplies a model file or skips without pandas: it runs each block where a new user would, with no extra installed, and checks its answer against 100 e^(-0.5 t) at t = 10, and each value a comment says the block prints. The quickstart's parameter-sweep example set kf, kr and kcat, which that model does not have; it now sets k, and the test runs it after the first block.

  • run_protocol skipped a set before the first run of an actions block with no generate_network, as already in the network (#1687). On a .net loaded on its own, setConcentration("A()",50) then a run gave A(1) = 36.79 for 18.39; that is the actions file omex_to_net writes. parse_bngl_protocol now generates the network at the first run only where the text holds a model; an actions block alone runs every action on the network it is given, or from a readFile of a .net. omex_to_net's actions file holds the actions from the protocol's generation point, with any save before it made again, so an addConcentration before generation is not added twice; one it cannot make is refused, or noted under strict=False. write_bngl_protocol writes generate_network where a protocol generated its network after its first step.

  • The SED-ML written from a BNGL protocol had no data generators and no outputs (#1686). It did not say what any experiment reports, and nothing told its experiments from their parts: a run / add / run protocol wrote five tasks, three of them pieces of a chain. Each experiment now has a report, of the time and the model's observables (its species where it has none), read from the task that runs it; that of a run that continues earlier ones holds their rows first. bngsim-net2sbml --sidecar passes the network, so its reports name the observables.

  • bngsim could not replay an archive it wrote when an action named a species with a component, a state or a compartment (#1685). The archive's protocol names L(r) as the BNGL file does, and its SBML has the id L_r: run_protocol on load_model() and load_full_protocol() raised, and omex_to_net's actions file stopped BNG2.pl. read_sedml_protocol(..., sbml=) and load_full_protocol() now name each species and parameter by the SBML's id, so the protocol runs on the master model; load_full_protocol(entry) names them as another model entry does, the bundled .net by their BNGL names.

  • net_to_omex left no record in the archive of what its SED-ML's standard elements do not hold (#1684). A reset_conc=>1 scan after a run is exported from the initial state (A(1) = 36.79, 56.77, 68.33 for 20.88, 50.92, 66.17); a warning at export said so, and the report, bngsim-conversion.json and metadata.rdf read as for an exact export. Each such warning is now recorded in ConversionReport.sedml_lossy and in bngsim-conversion.json under sedml_lossy, and metadata.rdf says how many there are. ok and lossy still judge the network.

  • The documented export pipeline packed the .net BNG2.pl rewrote mid-protocol, and the archive started from the wrong state with every gate level PASS (#1683). At a simulate with no suffix, BNG2.pl writes model.net again with the state of that moment, and bngsim-omex pack model.net --bngl model.bngl replayed the protocol on top of it: for A -> 0 with an addConcentration of 50 before the run, the archive started at 200 for 150, and egfr_path.bngl's first run at Grb2 = 100163 for 100000. Given a .bngl, net_to_sbml now checks the .net's parameters and seed species against what it declares, with the actions before generate_network applied, and warns of and notes in lossy a .net that differs; net_to_omex (bngsim-omex pack) and bngsim-net2sbml --sidecar refuse it, or pack it with the warning and the note under strict=False / --allow-lossy. The interchange guide writes the network with Model.from_bngl(..., net_out=...).

  • A parameter set to an expression of other parameters was evaluated once, where BNG2.pl keeps it as that expression (#1682). After setParameter("k2","k1*3") and setParameter("k1",5), BNG2.pl runs k2 = 15 (A(1) = 75.00); run_bngl, run_protocol and the SED-ML export ran k2 = 3 (37.52), and a scan over k1 gave 50.12 for 75.00. The replay now keeps such a parameter as its expression through later actions, scans and saveParameters/resetParameters, until a number is set, and refuses one defined through itself, or through the network's own expressions, as BNG2.pl does. The SED-ML sets it again after each change to what it reads, a reset included, and at each point of a scan of it; a change to a parameter the SBML computes by an initialAssignment removes that assignment first, which overrode it. A value read from another tool's SED-ML is still evaluated once, as SED-ML says (StateChange.evaluated_once).

  • An ODE run that starts far from t = 0 returned a wrong trajectory with no error (#1681). The integrator advances its clock by t + h, and far out the doubles are coarse: A -> 0 at k = 1 over (1e15, 1e15 + 10) gave A(+5) = 0.00144 for 0.00674, and over (1e17, 1e17 + 64) A stayed at 1. A model that reads no clock (no function of time(), no table indexed by time, no event) is now run (method="ode") on the time elapsed since its start (its end, for a run below 0 that starts over twice as far out), wherever the run's end nearer 0 is at 2^20 or beyond, and reports the times asked for: counted from its start, it is the run from 0, to the bit, where its start is on the spacing of the doubles at the far end (always, below 0), and as accurate where it is not. A run nearer 0 is unchanged. A failure of a moved run whose message names a time names it on the run's clock and says which time to add. A model that reads the clock keeps the absolute one, as before; a switch on a counter clock moves with the run, its switch time placed from the counter (#1828); run_diffrax is not moved.

  • SUNDIALS' warnings were written to the process's standard output (#1680). They pass by sys.stdout, warnings and logging, so a run that is right could put lines into the output of the script that called it: A -> 0 at k = 1e9 from t = 1e6 wrote eleven [WARNING] ... t + h = t on the next step lines there, mixed into whatever the script printed or piped. They now go to standard error, where SUNDIALS' [ERROR] lines already went. SUNLOGGER_WARNING_FILENAME, SUNDIALS' own environment variable, still decides where they go when it is set: stdout puts them back, the null device drops them, and that holds too for the runs that drop their own warnings (a model with discontinuity or state-switch roots, KINSOL), which overrode it before. The solvers guide's Logging section says so, and that the variables are read once per solver context. A name SUNDIALS cannot open (a directory that does not exist) stops every run and solve, and the error now names the variable, where it said only SUNContext_Create failed.

  • An ODE run whose solution leaves through minus infinity in finite time returned a number near -1e286, with no error, when the species was declared at 0 or above (#1679). X' = -(1 + X^2) from X = 1 is tan(pi/4 - t), with no value from t = 3*pi/4 on; a run to t = 3 returned X(3) = -3.5e+286, where the same law with X declared negative, or run to plus infinity, was refused. Once X*X overflowed, the non-finite retry (GH #135) read X at 0, where the law is -1, and the run carried on. An overflow in the species' own law that is finite one atol below 0 is not an edge at 0, so such a slot now keeps its value and CVODE cuts the step: the run fails at the blow-up. An overflow that reaches up to 0, as exp(-1/S) does, one in another species' law, or one whose own law pushes the species back up toward 0 (an undershoot consumed at W*exp(-W/1e-7)), is read at 0 as before.

  • net_to_omex(bngl=<absolute path>) wrote that path into the archive's SED-ML annotation (#1678). An archive made to be shared carried the exporter's directory names, a user name among them. The protocol's source is now written as the file's name alone, in every SED-ML document write_sedml_protocol writes, so read_sedml_protocol reads back m.bngl, not the path it was exported from.

  • The SED-ML written from a BNGL protocol failed the official SED-ML L1V3 schema (#1677). write_sedml_protocol, and so net_to_omex(bngl=...), bngsim-omex pack --bngl and bngsim-net2sbml --sidecar, wrote listOfModels before listOfSimulations; the lists are now in the schema's order. Experiments are numbered by position, so a protocol that holds one Experiment twice (combine_protocols([p, p])) no longer writes sim_1 and task_1 twice.

  • read_sedml paired the first time course with the first model and every data generator, reading no task (#1675). A task on the second model listed ran the first, and a two-task document's spec carried the other task's outputs. It now reads the first task's simulation, its model (the file at the end of the model's source chain) and the generators of that task, and carries a parameter change of the model as params; a change it cannot carry is said, and so are the tasks it leaves unread.

  • An ODE row on the instant a counter reaches an event's threshold read the state before or after the event according to the run's length (#1673). x(0) = 0.1, x' = 1, at (x >= 2.6): S = 1: the row at t = 2.5 read S = 3 for t_end in (2.5, 4] and (32, 64], and S = 1 for (4, 32], with nothing else changed. The crossing time came from a two-point solve over a power of two at or above the run's end, which in doubles moves by an ulp with that scale. For a trigger whose truth changes where its residual first reaches 0 (>= or < on a rising counter, > or <= on a falling one) it is now moved to the first double at which the residual, as bngsim's threshold evaluator computes it, is 0 (or the nearest where none is), so the stop and the row no longer move with the run's length, and a row on that first zero holds the state after the event (#1124). So is one written with abs() or a square (abs(x - 3.1) <= 0.5), whose edges had been registered as strict. Solved over the crossing's own scale, not the run's end, a strict x > 2.6, == or != also stops at one double for every run length.

  • A saveParameters or saveConcentrations made before generate_network was lost from the SED-ML, and refused by the replay (#1668). Saved at k2 = 0, A = 50, set back, generated and reset, BNG2.pl runs A(1) = 18.39; the exported task ran the network as generated (56.77) under ok=True, and run_protocol refused it. Both now go back to the save: the network, with the actions that made the saved values applied again. A save of a value as the model declares it, which the network no longer holds, is refused by the replay and said by the writer.

  • bngsim read and wrote text in the locale's encoding, so a UTF-8 .bngl failed to load where the locale is ASCII, and was misread under Latin-1 or Windows' cp1252 (#1665). One non-ASCII character, even an em dash in a comment, made Model.from_bngl raise a bare UnicodeDecodeError; 83 of the 895 BNGL files in the parity models have one. Every text file bngsim opens, and the output of BNG2.pl it reads, is now UTF-8: 33 places, 7 of which ruff's PLW1514 does not see. That includes what bngsim writes: Result.to_csv, .gdat/.cdat, .net, BNGL and SED-ML files are UTF-8 on every platform, where on Windows they were in the ANSI code page. A .bngl with a byte that is not UTF-8 (a Latin-1 comment) is handed to BNG2.pl as it is. Its actions are read too, with such a byte as U+FFFD. A compiler's output is read in the encoding it writes to a pipe (the OEM code page on Windows, UTF-8 elsewhere). Output that is not valid has its bad bytes replaced, so BNG2.pl's own error is shown, not a decode error. A test reads the package's source and fails on a text-mode open that names no encoding, so the next one is caught.

  • A SED-ML scan ran its first range's raw values, whatever its setValue's math and whichever range it named (#1664). k = 10^x over x = 0, 1, 2 ran k = 0, 1, 2 (A(1) = 1, 0.368, 0.135 for 0.368, 4.5e-5, ~0), and so did a scan over a functionalRange 10^x or over a second vectorRange 1, 10, 100. read_sedml_protocol now runs the value the setValue's math gives at each iteration, over the range it names, a functionalRange evaluated over the range it is on. A sweep whose math reads the model's values, or uses math the reader does not evaluate, is said and recorded as lossy.

  • read_sedml read a data generator as its first variable and dropped its math (#1663). A generator A + B came back as species:A (0.135 for 1), and 100*A as species:A, with no warning. A generator is now an output only where its math is one variable as it stands; one that computes a value from its variables (a sum, a scaling, a normalization) is left out of spec.outputs, with a ConversionWarning that names it and its formula, since no output selector names it.

  • read_sedml_protocol read a foreign SED-ML document as one run per time course, chained, with every model change dropped and no task read (#1662). A task whose model set k2 = 0 ran the unchanged model (A(1) = 56.77 for 36.79); two independent tasks ran the second from where the first ended (50.92 for 56.77); two tasks on one time course were one run. On BioModels' SED-ML for BIOMD0000000010 the second task gave MAPK_PP(12000) = 79.8 for 92.7, with no warning. The document is now read by task: each task runs its model from its initial state, with the model's changeAttribute and computeChange changes (a species' value, a parameter's, a kinetic law's local as _lp_<reaction>_<id>, an addition) as the steps before it; a repeatedTask sweeps (a constant setValue beside it as a step) or chains its subtasks on one state; the state is reset between tasks; a chain that repeats the start of a longer one is read once. A change the replay cannot apply is said and recorded in spec.lossy, which run_protocol refuses unless allow_lossy. A species' initialAmount needs sbml= for its compartment's size, else it is lossy too.

  • A species negative where the model has it so, but not declared negative, followed the wrong ODE with no warning once another species tipped a rate law non-finite (#1661). The non-finite retry (GH #135) read every concentration below 0 at 0, so a voltage written to -61 by set_concentration, or one declared at 10 that its own law takes below 0, was read at 0 beside a sqrt of an emptied species: V(40) = -328.6 for -69.8. The retry now reads at 0 only the slots the non-finite rows of f, or of the Jacobian, read, and the #1340 band reading likewise; of those, it puts back each slot further below 0 than any rounding of 0 (10^6 of its atol) wherever the reading stays finite without it (also beside another slot at 0, P^1.5*log(-V)), and at any depth for the rest of the run once put back. At ExactAtol(1e-4) that threshold is 100, so a V crossing 0 on its own is read at 0 until it passes -100. This holds in the time course and the steady-state run test. Where no such reading is finite, the retry reads as before.

  • A run_batch row, or a parameter_scan or bifurcate point, was held to the default atol of the state the call was made from, not the one it started from (#1660). A row that doses a growing species decades below the model's value was held to a tolerance above that species, with no warning: a logistic grower declared at 1, dosed at X0 = 1e-9, returned X(20) = -4.6e-7 for 0.327 (-1.5e+292 at n_points=41), and a continuation scan of X' = -X returned -1.25e-8 for 2.06e-9. A scalar atol, the default or one passed, is now also read from each row's own start, as run() reads it, and each species takes the tighter of that and the model's reading, so no row is held looser than before; AtolScaleWarning reads the tolerance each row ran at. atol="auto" is still one vector per call, but each species takes its smallest scale over the rows' starts, not its scale in the live state, which gave the same -4.6e-7; steady_state_batch's does too. A batch reads the model's side at its initial conditions, not where a run left it.

  • SSA and PSA stored an event's concentration assignment over the load-time size in a compartment an assignment rule sizes (#1659). In c := 1 + time, at (time >= 2): S = 50 stored an amount of 50 where the size was 3, and [S](3) read 12.5 for 37.5. The event now stores the concentration times the size the rule gives at the event, as it already did for an event-resized or rate-rule compartment.

  • SSA and PSA recorded a row on a state trigger's crossing as before the event for some grids and after it for others (#1658). With q' = 0.1 from 0 and at (q >= 2.5): S = 1, the row at t = 25 held S = 3 at t_end = 25, 27, 30 and 50 and S = 1 at 26 and 40: the integral landed a few ulps either side of 2.5. A row now reads the rate-rule state a bisection tolerance ahead of it, with the clock at the row, as the ODE run reads it half a root tolerance ahead (#1133), so a crossing on the row fires before the row is taken. A trigger on the clock alone is read at the row as before, so time > 25 still holds the row at 25 before its event; one that compares the rate-rule state with the clock within that tolerance (q' = 1; at (q > time), with q equal to time) now fires at the first row, as it does under ODE.

  • A .net file that is not UTF-8 failed with a bare UnicodeDecodeError (#1653). A species name saved in Latin-1 (Aµ(), the byte 0xb5) loaded, and its name then raised an error that named neither the file nor the line; a refusal quoting such a line lost its words to the same error. Model.from_net and parse_net_file now refuse a line of the five blocks that is not UTF-8 with the ModelError and ValueError they document, quoting the line with the byte shown as \xb5, and show such a byte the same way in any other refusal, the table-function reader's of a table file among them. A byte in a comment, a block passed over or an action line still loads. write_net now writes UTF-8 whatever the locale: under a Latin-1 or cp1252 locale (Windows) it wrote such a byte, and could not write a name outside that encoding at all.

  • A .net Hill law whose exponent was moved into (0, 1) after loading failed at zero substrate (#1636). #1497's guard, which reads the law as 0 at S = 0 for 0 < h < 1, was written only where h was in (0, 1) at load, so set_param, a run_batch row, parameter_scan or a BNGL setParameter after generate_network that moved it there evaluated inf*0 and the run failed with CV_FIRST_RHSFUNC_ERR. The guard is now written for every Hill law, and the issue's model gives BNG2.pl's S(5) = 2.796028127 on each route. An SSA or PSA run after h is moved there no longer fails on a NaN propensity at S = 0. A run, with or without sensitivities, a steady-state solve and run_diffrax read a condition the parameter values decide, such as the guard's (h <= 0) or (h >= 1) at h = 2, as that constant and root nothing for it, so a model at h >= 1 does not pay the root's cost, and runs wherever it ran, but for one case: run_diffrax of a model loaded with h outside (0, 1) and given an h inside it by param_dict is now refused, as a model loaded there already was. A model with events keeps every root.

  • An expression's output sensitivity after run() reads sum, avg, asinh, acosh, atanh and other smooth built-ins (#1531). output_sensitivities raised for a function such as sc*sum(Atot,K) ("could not parse expression for differentiation") or sc*asinh(Atot/K) ("not representable in C"), while sc*(Atot+K) and steady_state() answered. These now return the derivative, as do erf, erfc, log1p, expm1, mul, logn, ncdf, deg2rad and rad2deg. hypot, cot, sec, csc, sinc and tgamma are still refused, as before.

  • A sensitivity parameter on a kink of a derived rate constant is refused, and a tie of one slope in one is weighed once (#1530). BNG2.pl writes an inline rate law such as 0 -> X() 10*min(q,1)+s as a derived parameter on an elementary reaction, and #1332's refusal read only functional rate laws: min at q = 1 returned dX*/dq = 23.81 (neither side's slope, 47.62 or 0), clamp at an edge and if() on its switch at a steady state one side's, with no error. Those are now refused in run(), run_batch, compute_all_sensitivities and steady_state(), for a derived parameter that an elementary or MM reaction's rate constant, a functional law or a species' initial amount reads, however deep the chain. max(q, q*a, q*b) at a = b = 1, which has a derivative, returned 71.43 for 47.62 in a derived rate constant, kcat or initial amount; it is 47.62 now.

  • The steady-state stability certificate could call a stable root unstable, and report a wrong spectrum, where a near-zero eigenvalue's row fed a species nothing reads (#1529). A $-fixed source S feeding X at k = 1e7, X read by nothing: steady_state(method="newton") returned root_stability == "unstable" with +6.9e-05 for an exact 0 and -1.000069 for -1, where numpy and steady_states() give the exact spectrum; at k = 6.31e7 it reported -1 as -0.968. The dense eigensolver's balancing skipped such an isolated row without moving it, and the zero's condition number was k. It now isolates rows and columns as LAPACK's dgebal does, and reads their eigenvalues exactly. Over the corpus, every certificate's label is unchanged and every spectrum moves by under 1e-12 of its radius.

  • save_concentrations() cleared the carried-over mark of a state a run had advanced, so the next sensitivity run started from dx(0)/dθ = 0 with no error (#1528). Without the save such a run raises, since the state is x(θ); with it, it returned dA(0)/d(kp, kd) = [0, 0] for [2, -8]: equilibrate, save, measure, and the dose set_concentration's docstring says to save. reset() to that baseline, a named snapshot or a Simulator.snapshot() of it restored, a clone or make_subset_model of it, run_batch rows from it and steady_state(sensitivity_params=...) on it did the same. The save now keeps the mark, the baseline and both kinds of snapshot keep it for reset(), the restores and clone(), and all of these raise. A save of a state no run advanced, such as set_concentration doses on a fresh model, is still literal initial conditions. So differentiable_solve after a run and a save, which #1521's warning offered as a start with derivative 0, now refuses, and so does sensitivity_ic from a restored snapshot of an advanced state, where a later set_param of an initial-condition parameter no longer moves species.

  • A Sat or Hill rate law on a repeated reactant now loads (#1527). BNG2.pl writes A() + A() -> B() Sat(kcat,Km) as 1 1,1 2 0.5*Sat kcat Km, and Model.from_bngl, Model.from_net and parse_net_file refused it with "does not yet support repeated/non-unit reactant stoichiometry". The rewrite to a Functional law now reads reactant positions, as run_network does, so these models give run_network's trajectory (A(1) = 4.407330663 for Sat, 3.881617517 for Hill), in ODE, SSA and sensitivity runs. A second saturation constant on a repeated reactant (0.5*Sat kcat Km K2) is counted against the reactant positions, as BNG2.pl counts it.

  • steady_state_batch started every entry from the initial conditions, not a state the caller had written, with no word (#1521). After set_concentration("A()", 20) in A <-> B it returned the steady state of the seed total, [3.33, 6.67] for [6.67, 13.33], and in a bistable model the other branch, each converged=True, where run_batch warns on the same state (#1362). The reset stays, since it is what puts an initial-condition parameter's dose into each entry. The batch now warns where the model's state differs from its initial conditions and states= is not given, and its docs, the steady-state guide and the API reference say where an entry starts. bngsim.jax.differentiable_solve, which resets its clone the same way, warns too. Each warning, run_batch's included, now says that a start from the current state drops a dose written to an initial-condition parameter, and zeroes its derivative: after a run, a batch over A0 = 5 and 40 gave totals 10 and 10 from either remedy. Model.reset() first keeps the dose.

  • steady_states() merged distinct roots closer than tol in concentration, and dropped one of a nanomolar switch's three (#1518). The clustering took tol, a residual tolerance in concentration per time, as an absolute merge distance in concentration. In molar units at nanomolar scale the Schlogl switch's roots at 0.2 nM and 0.5 nM were one root, the seed decided whether the attractor or the saddle survived, and nothing warned; the same model at unit scale gave all three. The floor is now a distance in concentration: for each species, 1e-9 of the largest value it takes at any converged start, or double precision's resolution beside the largest magnitude the solves saw, whichever is larger, beside the law floor that was already there; SteadyStates.cluster(atol=None) derives it, and a given atol is used as given. tol plays no part. A start KINSOL leaves short of its root (Newton distance above 1), accepted under tol, is now solved once more from where it stopped: without tol as the floor it would come back as a root of its own.

  • A kinetic law's local parameter named like a compartment, or like a species outside the reaction, was read as that global in a mass-action law (#1503). In C*k*S with a local C = 7, the local was cancelled against the storage volume as the compartment, and in k*S*Q with a local Q it was multiplied in as the species Q: S = 2.456 and 2.222 where SBML scoping gives 0.740. The right-hand side, the Jacobian, the SSA propensity, both codegen paths and forward sensitivities shared the wrong rate, with no warning. The mass-action classifier now reads a law's locals first, as the Functional path already did, so the reversible splitter and a local shadowing the reactant itself (L3V1) read them too. A shadowing local also no longer marks the reaction as reading the compartment's size, which refused a write to that size for nothing.

  • A .net MM reaction with three or more reactants left all but two out of its rate (#1502). S + E1 + E2 -> P + E1 + E2 at MM kcat Km ran with E1 as the whole enzyme, P(1) = 0.896350 where run_network gives 3.318492, and with E2 when the enzymes were listed the other way round, with no warning. Every engine read the first two reactants only. Model.from_net, parse_net_file and ModelBuilder now refuse an MM reaction with more than two reactants, as BNG2.pl refuses such a rule, and say how to write run_network's reading of it as a functional rate law. One or two reactants load as before.

  • write_sbml flattened a comparison of a comparison, even BNG2.pl's bracketed if(((0<x)<1),k,0) (#1499). ExprTk, BNG2.pl and run_network read (0<x)<1 as a comparison of the truth value of 0<x; libsbml's parseL3Formula dropped the brackets and wrote 0 < x < 1, and turned the "not" idiom (x>1)==0 into (x>1) && (1 == 0), so the written SBML gave A(1) = 3.679 for 10 and B(1) = 10 for 3.679, and net_to_sbml's gate passed a band model that stopped at 20 for 30. The writer now brackets every relational chain as ExprTk groups it (1<x<2, a==b<1, ...) and writes a truth value that a relational compares, a relational or a logical, as piecewise(1, cond, 0), which libsbml keeps and which is well-typed SBML. Function assignment rules and derived-parameter initialAssignments both go through it.

  • SSA and PSA computed observables and expressions on the stored count over the load-time size in a compartment whose size moves (#1464). After an event resized c from 2 to 4, B := 2*X reported 64 for 32, and every observable or expression that read X read it at twice its concentration; the same under a rate rule, and in a compartment an assignment rule sizes (c := 1 + time), where p := 2*S and the observable S never moved. The rows' observables and expressions now read such a species at its count over the compartment's live size, as the ODE run reads it. The run itself still goes on from the stored count.

  • SSA and PSA started a concentration species from its count at the compartment's load-time size, where its starting size had been written (#1463). With set_concentration("c", 3) on an event-resized compartment loaded at 2, X = 50 started at 100 molecules for 150 and stayed low by 3/2; the same for a rate-rule compartment, and for one an assignment rule sizes from a parameter that was written (c := V0 + time). A run that starts from the model's concentrations now counts them at the size the compartment has at its start. A run that goes on from where an SSA run left the model (a second run, run_until, run_replicates, save_concentrations and reset, a named snapshot, a clone) keeps the counts it left, and an SSA run after an ODE run counts the ODE's concentrations at the size then. A concentration written with set_concentration over the state an SSA run left is still read as a count, as it was before.

  • Forward sensitivities across a narrow pulse's corner were up to 1e-3 off on some output grids, with no error (#1456). CVODE finds the corner inside a step that went past it, and that step's corrector applies the post-corner rate to the whole step, so the sensitivities it hands over at the corner can be 1e-4 to 1e-2 off even though the step passed its error test. Those columns are now integrated again over that one step from its start; this is used only where the re-integration checks out as accurate. On the issue's triangle at rtol 1e-8 the worst grid moves from 1.4e-4 to 1.5e-5.

  • Forward sensitivities across a narrow pulse whose rate law reads time() were off by up to 3e-4, with no error (#1455). The restart a hair past a rate-law switch moves the state and keeps the clock, and where the right-hand side reads the clock, where it restarts depends on when the switch crossed, which moves with each parameter. The sensitivities now carry that term. A triangle 0.003 wide in Tobs + time() is now right to the clock's own rounding, 1e-5 at t = 25. Models that do not read the clock are unchanged.

  • Forward sensitivities across a narrow pulse that jumps were slightly off, with no error (#1454). After a rate-law switch that jumps, the run restarts a hair past the switch, and the sensitivities were left behind the state there, as #1285 fixed for continuous switches. On a rectangle 0.003 wide in a clock, dY/dk_clock was 4.6e-5 off at every tolerance; it is now right to 3e-9 at rtol 1e-12. A re-taken step could also stop on the crossing it was re-taking and lose that crossing's jump in the sensitivities, which now restarts at the crossing instead.

  • SSA runs with recurring events far from t = 0 came back slow, with no error (#1436). On the continuous loop (a rate that reads the clock, or a rate rule), each event's restart counted the hazard to the event's time and moved the clock to the double it rounds to, up to half a spacing of the doubles later; and a firing whose rounded time reached the double where an event's trigger turns over drained that event and restarted its waiting time from the rounded time. 500 events a unit busy at t = 1e12, where the doubles are 1.2e-4 apart, fired 2.27% too slowly (z = -17.6). The hazard now runs to the double the clock moves to, what passes E there goes on to the next waiting time, and a firing's restart carries the time its rounding moved the clock past it: that case comes back within about 0.05% of the exact rate, and 1000 events a unit at a rate of 500 within noise. Near t = 0 these agree with what ran before to rounding.

  • The "New test files run somewhere" check read a pytest command that names no path as running nothing, though pytest then runs testpaths (python/tests). Such a workflow was skipped, and a new file only it ran was reported as run by no check. A command with no path now runs the whole suite; one with --version, --help, --collect-only, --fixtures or --markers runs none. A redirect's file descriptor (2>&1) is not read as a path, and a step whose command is pytest alone is read. No workflow runs pytest that way today, and the six that run it read the same as before.

  • A network-free run with connectivity on no longer reads three uninitialized NFsim flags. NFsim's System constructors leave trackConnected, printConnected and trackRxnNumber unset; only NFsim's own command line sets them. Whatever the heap held could turn on per-firing debug logging to files that were never opened, which slowed runs and is undefined behaviour; under the sanitizers it stopped six connectivity tests every night since #1818 (#1816). bngsim now sets all three to false when it loads a model.

  • Two nightly checks failed on their own test setup, not on bngsim. The sanitizer job stretches each run's timeout through a wrapper around Simulator.run. A warning raised with a fixed stacklevel named the wrapper's frame instead of the caller's line, and Result.rerun() stretched an already-stretched timeout a second time: three tests failed there and nowhere else (#1816). The weekly live parity run built AMICI from source with the newest swig, and AMICI then refused to compile any model against the swig uv.lock installs, so every AMICI sensitivity reference failed (#1824). The wrapper is now skipped when frames are counted, the rerun test's timeout is one the wrapper leaves alone, and pyproject.toml pins the swig AMICI is built with to uv.lock's.

  • parameter_scan over a parameter that seeds an initial condition dropped the dose after a run, and no warning said so. Each point starts from the state at the call, and a parameter write moves a species only while it sits on its initial condition: a scan over A0 = 5 and 40 after a run started both points at the run's A = 6.07 (found on #1643). The scan keeps that start, which a pre-equilibrated protocol relies on, and now warns, naming the species it does not move, through a derived initial condition too (A = A0*s), a compartment size and after save_concentrations() with no label; in a sensitivity scan, where no write moves a species, it names every species the parameter seeds. The warning, a ScanDoseWarning, names Model.reset() first, for a dose scan from the initial conditions (outside a sensitivity scan, which refuses that start), and an on_point hook, to dose from the current state. Where the scan also raises LiveStartWarning, that warning no longer offers save_concentrations(), which would not dose them. Each Result records the dose warning in notices as scan.dose_dropped.