Repository navigation
Release notes for sbmlsim 0.61.0
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 sbmlsimneeds no--extra-index-url: libroadrunner andpackagingare no dependencies any more, the check of the installed libroadrunner atimport sbmlsimis gone (sbmlsim.engine.check_roadrunner, the variableSBMLSIM_SKIP_ROADRUNNER_CHECK), and so are the extrascopasiandamiciand the variableSBMLSIM_AMICI_CACHE. A project which installed sbmlsim with the index of the builds of libroadrunner drops the index, its[tool.uv.sources]entry andlibroadrunneras 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.
engineofSimulator,load_model,SimulatorSettings,ExperimentRunner,run_experiments,OptimizationProblem,FitDefinition,run_case,run_suite,case_csv,write_submission,scripts/testsuite.py --engineandverify dump --engine:"core"warns and is ignored, any other engine raises aValueErrornaming sbmlsim-compare (sbmlsim.engine.check_engine). A project whose settings name another engine is refused where its settings are validated;verifyexits 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 variableSBMLSIM_JIT_OPTIMIZATIONis logged once per process and ignored.- The names of the engines:
sbmlsim.engine.Engine(the memberCOREonly;Engine.ROADRUNNERandEngine("copasi")raise naming sbmlsim-compare),DEFAULT_ENGINE,resolve_engineandJitOptimization, also ofsbmlsim.simulatorandsbmlsim.model. sbmlsim.model.model_core.CoreSBMLModelis an alias ofsbmlsim.model.SBMLModel, see below.- The check
cross_simulatorof the credibility battery is retired: its settingscross_simulator,enginesandcompile_timeoutofBatterySettings, the fieldcross_simulatorofBatteryCase, the optionscross_simulatorofrun_battery,verify,assessand of the kindcredibilityof the run layer, and the id inBatteryHook.orderare accepted with a warning and ignored.
Removed
- The models of the engines:
sbmlsim.model.model_roadrunner,RoadrunnerSBMLModel(sbmlsim.model.RoadrunnerSBMLModelraises naming the migration),CopasiSBMLModelandAmiciSBMLModel, withmodel/comparisons.pyandmodel/event_rows.py. Load a model withsbmlsim.model.load_model. Project.load_roadrunner: useProject.load_model(variant), the variant as anSBMLModelwith the integrator settings of the project; for one release the method raises naming it.import_copasi,import_amiciandcheck_roadrunnerofsbmlsim.engine(and the first two ofsbmlsim.simulator): for one release they raise anImportErrornaming sbmlsim-compare when they are called, the error their callers handled for an engine which was not installed.amici_cache,using_amici_cacheandkept_encodingare gone.- The executors and the pool of the scans of the engines:
sbmlsim.simulator.executor,executor_copasi,executor_amici,engines,segments,changes,workerandshared. A scan runs on the threads of the engine core in one process, as on the default engine since 0.58.SteadyStateErrorlives insbmlsim.simulator.executor_core.sbmlsim.parallel.shared_payloadsis gone with them. - One model class.
SBMLModelis 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 attributeassignmentsandtakes_integrator_setting, and so aresbmlsim.model.model_core.core_model,sbmlsim.model.model_sbml.PORTABLE_SETTINGS,ROADRUNNER_ONLY_SETTINGSandEngineSettings. The settings the engine takes and the ones it ignores with a report areREQUEST_SETTINGSandIGNORED_SETTINGSofsbmlsim.model.model_core, whereORDER_SETTINGSmoved as well. A simulator of another engine subclassesEngineModelof sbmlsim-compare.load_modelandProject.load_modelreturn anSBMLModel;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_PACKAGESand the argumentengineofcollect_versionsandcreate_provenance,ExperimentRunner.jit_optimizationand the fieldengineofModelKey,sbmlsim.testsuite.runner.check_engine(sbmlsim.engine.check_engineis the one check), the argumentzerosofsbmlsim.simulator.pk.doses_of(a value of zero is a dose now, as withzeros=True, sodoses_of(plan, dose)gives the zero dose of a control where it left it out by default; the only caller of sbmlsim passedzeros=True, so no result changes),BenchmarkProblem.run(in_core=)(nowrun(skip_gaps=)),with_deadline,CompileTimeout,COMPILE_TIMEOUTandCROSS_SIMULATORof the battery,BatteryRun.r(nowsimulatorandmodel),scripts/engine_benchmark.pyand 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 insbmlsim.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 ofsbmlsim.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 insbmlsim.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 aReleaseErrornaming 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.mdlists the names other packages build on (sbmlsim-compare among them), andtests/test_api_stability.pychecks 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 withPetabReader. - 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_simulatorstill 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 dumpand 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.coreread 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 unlessSBMLSIM_CORE_TIMEOUT_MSgives 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
twoan earlier model defined in a fit problemtwo, so a request depended on the models the process had loaded before. It carries the units its texts underunit,unitsand*_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 stepdelta_degCin a product; the compiler of sbmlsim-core gets the kind spelledcelsiuswhere libsbml writesCelsius, 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 ofAbsoluteTolerance(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 (onCve_hctzof 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_simulatorof the kindcredibilitychanged fromtrueto 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.