Release notes for sbmlsim 0.51.0
Every figure of sbmlsim is drawn by the renderer of sbmlsim-core: figures_mpl() takes charts only and nothing of sbmlsim imports matplotlib (breaking). A formula before the simulation which reads a target a dimension of a scan pins is a fit of the engine, so no case of a scan stays a gap, and tests which failed on a loaded machine are robust.
Breaking changes (#704)
figures_mpl()takes charts only. A figure of the hook is asbmlsim.plot.Chart, drawn by the renderer and written in every format of the run with its spec, as the figures offigures()are. A project whosefigures_mpl()returns a figure of matplotlib (or any other object with asavefig) no longer gets it saved with a warning: the figure fails under its key withTypeError: The figure '<key>' of <Experiment>.figures_mpl() is a matplotlib.figure.Figure, not a sbmlsim.plot.Chart: every figure is drawn by the renderer of sbmlsim-core, so draw it with the chart builder (sbmlsim.plot.Chart) or describe it in figures(). Figures of matplotlib are no longer saved.Withon_error="raise"(a single experiment) the error is raised; in the runner (on_error="log") the figure is listed infailed_figures, a file of it from an earlier run is removed, and the other figures are written. A hook which raises still fails under the keyfigures_mpl()(nowHOOK_FAILURE).- Removed with that path:
sbmlsim.experiment.experiment.SavedFigure(annotate the hook asMapping[str, Chart]), the warning once per experiment class, the closing of the figures of pyplot;sbmlsim.plot.axes(limit_log_axis,limit_log_axes) andlog_limits,LOG_DECADES,LOG_MARGINofsbmlsim.plot.plotting, which only it used (a chart limits a log axis to six decades in sbmlsim-core,max_decadesof aChartAxis); the matplotlib keywords aStylewrote back (to_mpl_curve_kwargs,to_mpl_points_kwargs,to_mpl_bar_kwargs,to_mpl_area_kwargs,ERROR_CAPSIZE,SEDML2MPL_LINESTYLE_MAPPING,SEDML2MPL_MARKER_MAPPING; a style is still made from matplotlib keywords withStyle.from_mpl_kwargs); thempl_formatterof the unit registry (call pint'sureg.setup_matplotlib(True)and set it yourself); the matplotlib branch ofObjectJSONEncoder. MPLBACKENDis no longer set bypython -m sbmlsim.run,python -m sbmlsim.serve(__main__._default_backendremoved), the verify command and the profiler: no figure of a run is drawn by matplotlib.- matplotlib leaves the
devextra, and the pytest filter of its legend warning goes.
Features
- A formula before the simulation which reads a pinned target (#703). Python applies the values of a point of a scan before the formulas of the pre-initialization, so the condition of a point reads a pinned target as a number: a formula of the pinned target alone is folded into the number of the point, one which reads fitted parameters as well is a derived value over them with the pin in its constant or factor (a product of a pinned and a fitted parameter, the gap
parameter_valuebefore, included). The gapscanis gone. The residuals equal the ones of python; the HCTZ fit of Knauf1995 over a renal scan with such a formula runs in the engine in 2.2 s instead of 27.5 s in python.
Fixes
- A deadline which fires in the read of the loaded values names itself (#702). The read of the initial values of a model right after its load (
initial_values()) is converted as the load is (load_error), so a deadline there is theRuntimeErrorwhich names it, not the trap of the wasm runtime. - Tests robust under the load of the machine (#702): the timeouts of the subprocesses of the engine tests and of the fetch of the test suite cache are 300 s, and the test of the workers of a pool starting together waits at a barrier instead of a bound of 2 s.