Skip to content

0.63.0

Latest

Choose a tag to compare

@github-actions github-actions released this 01 Dec 22:01
ec4636d

Release notes for sbmlsim 0.63.0

sbmlsim

This is a breaking release. sbmlsim makes a clean cut: every compatibility path is gone (#805). The names, arguments and settings deprecated in 0.61 are removed without a further warning period and refused with an error naming them, stored data of earlier versions is refused, and the stored records of fits are migrated once with the new command python -m sbmlsim.run migrate. The payloads of panels, maps, live figures and apps dump every field, so their spec hashes change. See Migration for what each removed name became.

Panels take formula changes, protocols of changes and converted readouts, which the static bundle panelbundle/2 carries (#801); the figure model draws rules, legend entries alone and caps of error bars (#804); a fold of formula changes resumes its segments only in a chain, so a formula after a change at the time of an event reads the state with the event (#807). Requires sbmlsim-core 0.58.0; the web app of a model vendors sbmlsim-web 0.10.1 (#808).

Migration

Removed names and what replaces them

removed replacement
engine of Simulator, load_model, SimulatorSettings, OptimizationProblem, FitDefinition, run_case, run_suite, case_csv, write_submission, scripts/testsuite.py --engine, verify dump --engine nothing: sbmlsim simulates with the engine core, other simulators are compared in sbmlsim-compare. A SimulatorSettings or a project naming it is refused by pydantic (an extra field), Simulator(engine=...) raises a ValueError naming engine as no setting of the integrator, the functions raise a TypeError
jit_optimization of SimulatorSettings, FitDefinition, FitMappings, select_mapping_collections, load_model, ExperimentRunner, run_experiments, OptimizationProblem; the variable SBMLSIM_JIT_OPTIMIZATION nothing (the variable is read by nothing)
Engine, DEFAULT_ENGINE, resolve_engine, JitOptimization of sbmlsim.engine, sbmlsim.simulator and sbmlsim.model; sbmlsim.engine.check_engine, check_jit_optimization, DEPRECATION nothing
sbmlsim.model.model_core.CoreSBMLModel sbmlsim.model.SBMLModel
sbmlsim.model.RoadrunnerSBMLModel load_model
import_copasi, import_amici, check_roadrunner of sbmlsim.engine and sbmlsim.simulator sbmlsim-compare
Project.load_roadrunner Project.load_model(variant)
the check cross_simulator of the credibility battery: BatterySettings(cross_simulator=, engines=, compile_timeout=), BatteryCase(cross_simulator=), the option cross_simulator of run_battery, verify, assess and of the kind credibility, a BatteryHook.order naming it; RETIRED_CHECKS, retired_option nothing: the comparison of simulators is sbmlsim-compare's
engine_fit of run_optimization, run_fit, FitSpec and --engine-fit/--no-engine-fit nothing: every fit runs in sbmlsim-core
engine_profiles of profile_likelihood, ProfileSpec and --engine-profiles/--no-engine-profiles nothing: sbmlsim-core walks every profile
ProfileSettings.scan_timeout and the spec field scan_timeout nothing (timeout gives up the scans which have not begun)
check_engine_settings, PYTHON_OPTIMIZER_REMOVED, PYTHON_PROFILES_REMOVED, PYTHON_JACOBIAN_REMOVED, SCAN_TIMEOUT_REFUSED nothing
the tri-state engine_jacobian of fisher_information, JacobianSpec and --engine-jacobian/--no-engine-jacobian the bool require_sensitivities (--require-sensitivities): True requires the forward sensitivities and raises naming why a problem has none, False (the default) is the former None, the sensitivities where the problem has them and the central differences of sbmlsim-core otherwise; the former False (the jacobian of python) is gone
the settings of the integrator of roadrunner variable_step_size, jacobian, linear_solver, multiple_steps, max_output_rows; IGNORED_SETTINGS and the keys of IntegratorSettings nothing: refused like any name which is no setting (ValueError naming them) instead of ignored with a warning
FitSettings.variable_step_size nothing: FitSettings(variable_step_size=...) raises a TypeError, a stored dictionary with it is refused naming migrate, which drops it
the hook figures_mpl() of a SimulationExperiment charts(), which returns charts of sbmlsim; a class which still defines figures_mpl() is refused when it is initialized (TypeError naming charts()), so its figures are never dropped silently. HOOK_FAILURE is charts()
INTERPOLATION_CONSTANT, INTERPOLATION_LINEAR, INTERPOLATION_CUBIC_SPLINE InterpolationMethod.CONSTANT, .LINEAR, .CUBIC_SPLINE
HTML_GONE nothing: the figure format html is refused as a format which is none of svg, png, json
OptimizationResult.count_weighting_recorded, stored_count_weighting and the special case of settings_of nothing: a stored record names its rule (migrate it)
read_sections, read_acceptance, LEGACY_*, _LEGACY_CHECKS of the credibility, LEGACY_FRAMEWORK of the release manifest nothing: assess or build the release again
the fallbacks for older sbmlsim-core: carries_root_guard, the getattr of root_guard and of sensitivities on the output of a simulation, the default of n_discontinuity_roots nothing: the floor guarantees them

The open settings of an experiment and of a runner (SimulationExperiment(**settings), ExperimentRunner(**settings)) and the arguments of an optimizer (run_optimization, run_fit, OptimizationProblem.optimize, check_optimizer_arguments) refuse engine, jit_optimization, engine_fit and engine_profiles by name with a TypeError which says what replaces them (sbmlsim.engine.REMOVED_ARGUMENTS, check_removed), instead of passing them on; the closed signatures (profile_likelihood, fisher_information, run_experiments, load_model) raise python's TypeError for an unexpected keyword.

Stored records of fits: run the migration once

The readers of the records of a fit require every field and refuse an unknown one: FitSettings.from_dict (SETTING_NAMES; a record without count_weighting was read as smallest, without objective as least squares, without data_at_change as after, a float tolerance of 0.8.4 as its tolerance of every kind), OptimizationResult.from_json (optimizer_of, units, settings, provenance; RECORD_KEYS), FitProvenance.from_dict (e.g. fixed_values, sources), FisherInformation.from_dict (FISHER_KEYS; a record without its decomposition computed it), IdentifiabilityResult.from_dict (duration, incomplete, profiles_of), ProfileSettings.from_dict (exactly its settings, no scan_timeout, a timeout), ParameterPosterior.from_dict, ParameterSet.from_dict (units, cost, provenance; PARAMETER_SET_KEYS) and AbsoluteTolerance.from_dict. Migrate the stored records once:

python -m sbmlsim.run migrate PATH ... [--count-weighting smallest|row] [--dry-run]

migrate (sbmlsim.fit.records.migrate, sbmlsim.fit.migration) rewrites every JSON file of a fit below the given paths in place, writing each field with the value the readers of 0.61 inferred: count_weighting smallest (the rule of 0.59 and earlier) unless --count-weighting row is given, optimizer_of and profiles_of python, the decomposition of a Fisher information computed with sbmlsim-core as the readers computed it, and the defaults of the provenance, the posterior, the parameter sets and the absolute tolerance; it leaves out variable_step_size, the engine of the optimizer arguments of a run (core/sbmlsim-core, which optimizer_of states; a fit no longer writes it) and the provenance arguments engine, engine_fit, engine_profiles and jit_optimization. A rewritten file keeps its layout (its indentation, whether it escapes what is not ASCII, its final newline). Numbers are not touched and nothing is simulated; it prints every file it rewrites, a second run changes nothing, and --dry-run writes nothing. It refuses, before writing anything, a record of another engine or of engine_fit: false, settings without parameter_scale (which the problem read as LOG10 and the adopted record as LINEAR), a record naming another count weighting than the one given, a scan_timeout of a limit, and a file which is no JSON. Checked on the 69 adopted records of pkdb_models: their parameters, uncertainty, Fisher standard errors and settings read by the readers of 0.62 from the originals and by the readers of 0.63 from the migrated copies are identical, optimizer_of and profiles_of aside (None to python).

A run of the run layer whose spec or stored records use a removed field is not resumable (a spec naming engine_fit, scan_timeout, engine_jacobian or cross_simulator, stored runs of a fit without count_weighting or with variable_step_size): migrate its records or run it again; a credibility run alike. A run whose spec and records are current resumes, also one started under 0.59.

Other stored data of earlier versions is refused

  • PEtab: a problem whose extension sbmlsim is not EXTENSION_VERSION 0.8.0 is refused (extension_of), and the readers of the extensions before it are gone; the settings of the extension 0.8.0 have no variable_step_size. Export the problem again.
  • Credibility records of pkpdsim 0.17 to 0.19: CredibilityAssessment.from_json requires every field and raises RecordError naming the one a record lacks; a battery of a record needs the labels and factors of its checks and its sections, a scorecard baseline its uncertainty_robust and failed_checks. Assess again.
  • Scorecards: compare refuses a scorecard which lacks a column of the core (e.g. failed_checks or uncertainty_robust of an older version), naming them; verify scorecard reports it as a usage error. Write the scorecard of the records again.
  • The release manifest of pkpdsim 0.19 (no framework) is refused. Build the release again.
  • Design records require their generator, which every design and propagation writes now (sbmlsim-core, also the propagation, whose record named none); a record of 0.56 or earlier is refused when it is read. Run the design again.
  • Dumps of verify without a simulator (sbmlsim 0.59 or earlier) are refused by compare. Dump again.

Payloads and spec hashes of panels change

Every field of a panel, map, live figure and app payload is dumped, also at its default: PanelSimulation.start, changes, output and times, AppPage.scan (an empty list for a page without one), PageScan.values/points/on, PageScanPayload.on, LiveElementPayload.yerr (null where unset), and the parts of #801 (PanelCurve.conversion, MapReadout.conversion, PanelChange.value/formula/at, LiveBinding.x_unit/reads). The contracts keep their versions (panel/1, app/1, mappanel/1, livefigure/1), but the payloads and the spec hashes of the simulations change, so a stored answer or bundle is exported again. sbmlsim-web 0.10.1 reads them without a change.

Panels: formula changes, protocols and converted readouts

  • Formula changes (#801). PanelChange(time, target, value=None, formula=None, at=None) of sbmlsim.panel is a value or a formula of PEtab math over the selections of the model, the knobs of the panel as their numbers in their declared units and time, evaluated as the changes of an experiment (PEtab v2: every value of a time with the state just before it, then set together), e.g. (1 - f)*[X_res] + f*X_fresh. The service substitutes the knob numbers into a formula, runs a simulation per point when the changes differ by the point and folds formulas as an experiment does. Startup refuses a formula which is no math, reads a symbol which is neither a knob nor an entity, or reads one which is both.
  • Protocols of changes. at is the state of the knobs a change belongs to (a choice or a named stop, the rule of PanelData.at), so a choice knob without a target is a protocol of changes, which a scenario sets and a page scans. Two changes of one target and time must belong to different values of a knob.
  • Converted readouts. LinearConversion(factor, offset, unit) on PanelCurve.conversion and MapReadout.conversion delivers the value in unit (the model unit without) as factor * value + offset in the declared unit, e.g. -100 * alive + 100 in %; scale, colour bar and the zone curves of a readout are in the converted unit.
  • Live figures of formula changes. live_figures derives the formula changes of a plan as PanelChange(formula=...), and the x, y and yerr of a LiveBinding are formulas over the selections of the simulation and the knobs (reads, x_unit), so a curve of a function of task data derives as the binding of its formula, checked against the static figure at derivation and evaluated by the service on the run. A change or binding formula which reads an id of a figure knob is refused.
  • The static bundle is panelbundle/2: it carries formula changes and conditional numbers as run.forms (the form constant + Σ factor * value(selection) the engine evaluates from its state at the change, simulator.formula.linear_form, emitted only where it performs the IEEE operations of the formula; other shapes are refused by the export), the conversions as run.curves[id].conversion, the binding formulas, and the runs of a figure in the units of the model. sbmlsim-core 0.58.0 reads panelbundle/2 only, so an older host refuses it.
  • Demo: examples/panels/protocols.py:PROJECT on the toy lobule: a protocol knob of medium changes, a knob the formulas read, a map with an ATP loss readout in %, a page scan over the protocol, scenarios and the live figure of an experiment of medium changes.

The figure model

  • Rules (#804): Rule, Plot.rule(value, orientation="vertical", unit=..., label=..., **mpl) and Figure.rule(...), drawn in every plot of the figure after the plot's own rules. The value (a number in unit, or a quantity) is converted to the unit of its axis; a labelled rule has its own legend entry. Without a colour it takes the colour of the text and no place in the colour cycle. It is drawn at RULE_Z (-0.25), beneath the lines and over the bands, and refused when its axis cannot place it (a unit on an axis without a unit, a value of 0 or below on a logarithmic axis).
  • Legend entries alone: LegendEntry and Plot.legend_entry(name, xerr=, yerr=, capsize=, **mpl) add a key for the look of data, e.g. "Data, mean ± SD", after every other element.
  • Caps of error bars: error bars of curves, curves over points and bars get caps again, FigureSettings.errorbar_capsize (3 points), overridden per curve or entry by capsize= (0 for none); the fit report, the sensitivity bars and the charts of the documentation take the same style.
  • Rules and legend entries have no source in ElementOrigin, so a live figure draws them as the static figure does.

Bug fixes

  • A formula at a change of a model of events or delays is folded with the state of the simulation itself (#807, sbmlsim-core#258). A segment of the fold resumed from the state after the change before it and lost an event at the time of that change, a pending delayed execution or the history of a delay, so a later formula set a wrong value and every row after it was wrong (Simulator.simulate since sbmlsim 0.30.0 for delays and 0.37.0 for events, Simulator.run through the planner of sbmlsim-core, fixed in sbmlsim-core 0.58.0). A segment resumes only in a chain now; every other fold integrates every segment from the start of the plan. A simulation of a model of an algebraic rule with two formulas, which failed, now runs.

Changed results

  • Folds which are no chain: a simulation whose output has a time within the resolution before a formula changes in the last bits (e.g. 1.2e-15 relative); a fold of a model of events or delays with a formula after a change at the time of an event changes to the correct value. Such a fold costs one pass per formula.

Changed

  • Requires sbmlsim-core 0.58.0 (panelbundle/2, the forms of formula changes, the fix of the planner of sbmlsim-core#258; 0.57.0 removed FIT_FIELDS, FIT_REDUCTIONS and the spellings of the former export namespace of sbmlsim_core.ode).
  • The web app of a model vendors sbmlsim-web 0.10.1 (#808): the url of a citation breaks only after a slash or a dot, a tab title only between its words, and the table of the pharmacokinetic parameters of a panel scrolls in its own box. sbmlsim-web 0.10 requires the fields of the contracts which services before sbmlsim 0.60 left out.
  • The stable API (docs/api-stability.md): a name leaves the stable API in a minor release, named with its replacement in its release notes, without a deprecation period.
  • scripts/record_roadrunner.py moved to sbmlsim-compare.

Documentation

  • docs/plotting.md: the section Rules, legend entries and error bars; docs/serve.md: formula changes, protocols, converted readouts, panelbundle/2 and the payloads with every field; docs/fitting.md: records of an earlier version and the migration; docs/run.md: the command migrate and require_sensitivities; docs/simulation.md: which folds integrate from the start.