Skip to content

0.61.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Dec 16:30
· 2 commits to develop since this release
267820f

Release notes for sbmlsim 0.61.0

sbmlsim

sbmlsim simulates with one engine, the engine core of sbmlsim-core: roadrunner, COPASI and AMICI left the package for sbmlsim-compare, which compares the engine core with them. sbmlsim installs from PyPI alone, without a package index for libroadrunner. The engine core has been the default engine since 0.58, so a project which did not name an engine simulates as before; these notes are the migration of everything else.

The engines

  • One engine. Every simulation, scan, fit, analysis, panel and app runs on the engine core (sbmlsim-core, Rust, SBML compiled to WebAssembly, CVODE and IDA of SUNDIALS). roadrunner, COPASI and AMICI moved to sbmlsim-compare, which builds on the stable API of sbmlsim (below) and compares the engines on the SBML Test Suite, the PEtab suites, BioModels and the model packages.
  • Installation from PyPI. pip install sbmlsim needs no --extra-index-url: libroadrunner and packaging are no dependencies any more, the check of the installed libroadrunner at import sbmlsim is gone (sbmlsim.engine.check_roadrunner, the variable SBMLSIM_SKIP_ROADRUNNER_CHECK), and so are the extras copasi and amici and the variable SBMLSIM_AMICI_CACHE. A project which installed sbmlsim with the index of the builds of libroadrunner drops the index, its [tool.uv.sources] entry and libroadrunner as a direct dependency, unless it uses roadrunner itself.
  • Requires sbmlsim-core 0.55.0 (the drawings of the renderer: currentColor, a figure without paper cropped to its panels and groups of elements; every figure of before draws the same bytes).

Deprecated, accepted for this release and removed in the next

Every deprecation warns with a FutureWarning, which python shows by default wherever the warning comes from, so a setting of a project module or of a stored file is seen outside of a test run as well.

  • engine of Simulator, load_model, SimulatorSettings, ExperimentRunner, run_experiments, OptimizationProblem, FitDefinition, run_case, run_suite, case_csv, write_submission, scripts/testsuite.py --engine and verify dump --engine: "core" warns and is ignored, any other engine raises a ValueError naming sbmlsim-compare (sbmlsim.engine.check_engine). A project whose settings name another engine is refused where its settings are validated; verify exits with 4 for it.
  • jit_optimization, the optimization level of roadrunner, wherever it was taken (SimulatorSettings, FitDefinition, FitMappings, select_mapping_collections, load_model, ExperimentRunner, OptimizationProblem): every level warns and is ignored. The variable SBMLSIM_JIT_OPTIMIZATION is logged once per process and ignored.
  • The names of the engines: sbmlsim.engine.Engine (the member CORE only; Engine.ROADRUNNER and Engine("copasi") raise naming sbmlsim-compare), DEFAULT_ENGINE, resolve_engine and JitOptimization, also of sbmlsim.simulator and sbmlsim.model.
  • sbmlsim.model.model_core.CoreSBMLModel is an alias of sbmlsim.model.SBMLModel, see below.
  • The check cross_simulator of the credibility battery is retired: its settings cross_simulator, engines and compile_timeout of BatterySettings, the field cross_simulator of BatteryCase, the options cross_simulator of run_battery, verify, assess and of the kind credibility of the run layer, and the id in BatteryHook.order are accepted with a warning and ignored.

Removed

  • The models of the engines: sbmlsim.model.model_roadrunner, RoadrunnerSBMLModel (sbmlsim.model.RoadrunnerSBMLModel raises naming the migration), CopasiSBMLModel and AmiciSBMLModel, with model/comparisons.py and model/event_rows.py. Load a model with sbmlsim.model.load_model.
  • Project.load_roadrunner: use Project.load_model(variant), the variant as an SBMLModel with the integrator settings of the project; for one release the method raises naming it.
  • import_copasi, import_amici and check_roadrunner of sbmlsim.engine (and the first two of sbmlsim.simulator): for one release they raise an ImportError naming sbmlsim-compare when they are called, the error their callers handled for an engine which was not installed. amici_cache, using_amici_cache and kept_encoding are gone.
  • The executors and the pool of the scans of the engines: sbmlsim.simulator.executor, executor_copasi, executor_amici, engines, segments, changes, worker and shared. A scan runs on the threads of the engine core in one process, as on the default engine since 0.58. SteadyStateError lives in sbmlsim.simulator.executor_core. sbmlsim.parallel.shared_payloads is gone with them.
  • One model class. SBMLModel is the model of sbmlsim, compiled by sbmlsim-core, and no abstract base any more: the hooks of the executors of the other engines are removed without a deprecation, initialize, reset, simulated, the attribute assignments and takes_integrator_setting, and so are sbmlsim.model.model_core.core_model, sbmlsim.model.model_sbml.PORTABLE_SETTINGS, ROADRUNNER_ONLY_SETTINGS and EngineSettings. The settings the engine takes and the ones it ignores with a report are REQUEST_SETTINGS and IGNORED_SETTINGS of sbmlsim.model.model_core, where ORDER_SETTINGS moved as well. A simulator of another engine subclasses EngineModel of sbmlsim-compare. load_model and Project.load_model return an SBMLModel; SBMLModel.tolerances() is the table of the absolute tolerances of its states.
  • Elsewhere: sbmlsim.serve.runner.SHARED_ENGINES (the panels of one simulation always share their run), fit.provenance.ENGINE_PACKAGES and the argument engine of collect_versions and create_provenance, ExperimentRunner.jit_optimization and the field engine of ModelKey, sbmlsim.testsuite.runner.check_engine (sbmlsim.engine.check_engine is the one check), the argument zeros of sbmlsim.simulator.pk.doses_of (a value of zero is a dose now, as with zeros=True, so doses_of(plan, dose) gives the zero dose of a control where it left it out by default; the only caller of sbmlsim passed zeros=True, so no result changes), BenchmarkProblem.run(in_core=) (now run(skip_gaps=)), with_deadline, CompileTimeout, COMPILE_TIMEOUT and CROSS_SIMULATOR of the battery, BatteryRun.r (now simulator and model), scripts/engine_benchmark.py and the page Benchmarks (both in sbmlsim-compare).
  • Helpers of the other engines, in sbmlsim-compare where they are still needed and in no stable API: the check of the installed libroadrunner in sbmlsim.engine (installed_roadrunner, roadrunner_requirement, roadrunner_problem, satisfies_requirement, ROADRUNNER_INDEX, ROADRUNNER_DISTRIBUTION, SKIP_ROADRUNNER_CHECK, INSTALLATION_DOCS); the feature checks of the models of COPASI and AMICI and their values in sbmlsim.model.model_sbml (variable_features, Feature, conversion_factors, rate_rule_entities, reads_csymbol, reads_delay, reads_rate_of, sbml_maths, DELAY_URL, RATE_OF_URL, INITIAL_SUFFIX, EngineValues); the evaluation of the PK observables in python of sbmlsim.simulator.pk (PKNode, evaluate_pk, MIN_PADDED_LENGTH), which the engine core evaluates in a scan; the chunking of the pool of the scans, sbmlsim.simulator.simulator.MAX_CHUNK; the seed of the order of simultaneous events of roadrunner in sbmlsim.testsuite.runner (seed_event_order, RANDOM_EVENT_EXECUTION), since the engine core orders them itself and draws nothing.
  • release.project.PackageIndex: a model release resolves from PyPI only. A source whose lock takes packages from another index is refused when the release is prepared, with a ReleaseError naming the packages and the index, before the release repository is cloned. pkpdsim and pkdb_models drop libroadrunner and the index of its builds with their floor of sbmlsim 0.61.0, before any model release on 0.61.0.

Changes

  • The stable API. docs/api-stability.md lists the names other packages build on (sbmlsim-compare among them), and tests/test_api_stability.py checks them: a listed name keeps its path, meaning and parameters within a minor release, a deprecated one warns for one minor; everything else, and every name with an underscore, may change.
  • The SBML Test Suite on the engine core. The runner of the suite simulates on the engine core only, which passes 1754 of the 1789 semantic cases (the 33 cases of a fast reaction and 2 cases which fail their conversion are the rest). The repeat check of a case is the determinism of the engine: a case which passes is simulated again after a shorter simulation and must give the first results bitwise. The report and the manifest of the submission name sbmlsim-core instead of libroadrunner.
  • The PEtab benchmark collection runs every problem in sbmlsim-core; a problem of CORE_GAPS (none now) is skipped with its gap instead of read with PetabReader.
  • The credibility battery on the engine core. Every generic check simulates the variants on the engine core, and the factor of numerical code verification cites the result of sbmlsim-core on the SBML Test Suite and the agreement reports of sbmlsim-compare; the provenance of an assessment records sbmlsim-core. Records with the check cross_simulator still read, and the scorecard takes a check missing from a newer record as retired and no regression, while it now reports a check which newly fails.
  • Helpers which used roadrunner as a tool run on the engine core, checked against the records of roadrunner taken before the switch: parameters_from_sbml (the values of the engine core), typical_scales, the absolute tolerances of the states in a panel bundle, verify dump and the battery.
  • An SBML file is read in the encoding of its XML declaration, also UTF-16 with its byte order mark, and with every line end as LF, as XML reads it, so a file with the line ends of windows gives the SBML of every platform; an unknown encoding raises a ValueError.
  • A PEtab problem runs on the runtime of the simulations (#795). sbmlsim.fit.petab_v2.core read a problem on a runtime of its own with a deadline of 30 s, so the evaluation of a problem of a large model, the PEtab test suite and the benchmark collection depended on the load of the machine; a problem now has no deadline unless SBMLSIM_CORE_TIMEOUT_MS gives one, and a deadline which fires names itself.

Bug fixes

  • A request carries the units of the host it uses as units (#796). A request of sbmlsim-core carried every unit of the host whose name was an identifier of the request, e.g. the unit two an earlier model defined in a fit problem two, so a request depended on the models the process had loaded before. It carries the units its texts under unit, units and *_unit(s) use.
  • The unit kind celsius of SBML Level 2 Version 1 (#796) reads as pint's degC, the temperature on the Celsius scale, alone, and as a step delta_degC in a product; the compiler of sbmlsim-core gets the kind spelled celsius where libsbml writes Celsius, so a change in °C or K converts into the model, and a knob of a temperature converts into such a target with its offset. A model of this kind failed to load before.
  • The unit kind avogadro (#791, released in 0.60.1 without a note) loads as the dimensionless count of its level and version: 6.02214179e23 in Level 3 Version 1 and 6.02214076e23 in Level 3 Version 2.

Changed results

  • For a project which named roadrunner, COPASI or AMICI: its results are the ones of the engine core, which the default engine gave since 0.58. sbmlsim-compare reports the agreement of the engines on the models of the suites and packages.
  • Typical scales (sbmlsim.simulator.scales.typical_scales, the scales of AbsoluteTolerance(relative=...)) move by about 1e-5 relative against 0.60: the scale of a state is the largest magnitude over the steps of the integrator of the engine which ran the test simulations, and the maximum over the own steps of each engine misses the peak by its own amount (on Cve_hctz of the HCTZ model the engine core by 1.6e-5, roadrunner by 1.9e-5; on a dense grid the engines agree to 1.1e-11). The states with a scale are the ones of the engine core (SBMLModel.state_ids: the species a reaction or a rate rule changes and the targets of rate rules), so a floating species which no reaction changes, which roadrunner integrated, has no scale; a stored scale naming one already failed on the default engine in 0.60.
  • Events which trigger each other in a cycle: an event which executes more than 1000 times at one time fails the simulation on the engine core, where the executor of roadrunner warned and went on.
  • A credibility run started under 0.60 cannot be resumed under 0.61: the default of cross_simulator of the kind credibility changed from true to none, so the planned spec, and with it the hash a resume compares, is another one. Start such a run again into a new out.