Release notes for sbmlsim 0.12.1
A patch release of three fixes of the memory and the speed: the units of a model are read without a leak of libsbml, a figure is measured with one small renderer instead of being drawn many times while it is built, and a run without observables simulates only the selections it keeps. The simulations, the units, the fits and the figures are unchanged.
Fixes
- The derived units of a model are matched without
areIdenticalof libsbml (#383).UnitsInformation.from_sbml_docmatched the derived unit of every rule and kinetic law with the unit definitions of the model bylibsbml.UnitDefinition.areIdentical, which keeps memory on every call for a unit with a multiplier other than 1 (libsbml 5.21.2, sbmlteam/libsbml#503): 11 to 31 kB per call, about 13 MB per model and 10 GB in one python which ran the tests of all models of pkdb_models.unit_signaturegives the kinds of a unit definition with their summed exponents and the factor of its multipliers and scales, and a derived unit is the first unit definition with the same signature (the factor to a relative1e-12). The units of all 286 SBML models of pkdb_models are the same as withareIdentical; the fast tests of pkdb_models in one python peak at 2.1 GB instead of 10.0 GB and take 7:21 instead of 13:36 min. - A figure is measured with one renderer and not drawn (#385).
_fit_margins,_wrap_label(#362, released in 0.12.0) and_place_rightofMatplotlibFigureSerializermeasured texts, legends and axes without a renderer, so matplotlib drew the whole figure into an Agg renderer of the size of the figure, dozens of times while it was built, and every text kept the renderer it was measured with until the figures were saved.to_figuremeasures with oneRendererAggof a single pixel at the resolution of the figure (_measuring_renderer), since the extents of a text depend on the resolution of the renderer, not on its size.run_simulation pkdb_models.models.hctz --action simulate --experiments all(128 SVG figures) takes 19.4 s instead of 37.5 s and peaks at 0.52 GB instead of 12.1 GB; the SVGs are the same. - A run without observables simulates only the selections it keeps (#386).
Simulator.run(model, scan, keep=[...])without observables simulated every selection of the model and dropped the oneskeepdoes not name only from the result, sinceidentity_graphtook all selections as the selections of roadrunner, which computes every selection at every output time.identity_graphresolveskeepfirst and builds the graph of the kept selections only. A scan of the 267 selections of midazolam which keeps[Cve_mid]took 6.1 ms per point, four times a run of the same scan with two observables (1.5 ms). The errors ofkeepare unchanged, a name which is not a selection still lists every selection of the model.