Repository navigation
Release notes for sbmlsim 0.35.0
What a model says it accepts reaches the tools which vary it: sbmlsim reads the domain of a quantity out of the SBML of its model, a local design stays inside it and a sensitivity is differentiated over the step a design really took. The Fisher information of a fit takes the forward sensitivities of the engine instead of a jacobian of difference quotients, so the standard errors, the correlations and the rank of an identifiability report are read off the exact derivative. A dump of verify simulates with the engine and the tolerances of the project it verifies, and two performance defects of a run are fixed: the folds of the points of a scan are batched, and the experiments of a run are spread over the two pools which do not compose. The executor runs on a build of libroadrunner which fixes two rounding defects of its event times, so it carries no workaround for them any more and the tests have no expected failure.
Features
-
The steps of a local design stay in the domains of their targets (#592, #593).
sbmlsim.domainsreads the domain contract of the models of pkpdsim (matthiaskoenig/pkpdsim#207): adistribuncertainty nameddomainwhose single span is of the typerange, on the parameter, compartment or species it constrains.Domainis the closed interval and the value set a model accepts for a quantity - every real number, the integers of an index, a count or a class, or the two truth values of a flag, which anexternalParameterof the XSD datatype as itsdefinitionURLstates - withclipandcontains;domain_of(sbase)reads one element anddomains(sbml)a whole model, from its SBML or its file. The domain of a quantity is not the uncertainty of its value: the confidence interval of a literature value and the distribution of a fitted parameter are statements of their own, in their own uncertainty elements next to the domain on the same element. The module imports libsbml and the standard library only, so a library which must not load a simulator can read it.sampling.localclamps every step to the domain of its target, the domains of the model unlessdomains=gives them ({}clamps nothing): a fraction whose reference is 0.94 is evaluated at 1 and no longer at 1.081 for a relative delta of 0.15, more than the whole dose absorbed, and a parameter which is a class of integers, whose relative step is no value of its domain, stays at its reference. The record of the design keeps the two values of every clamped target in itsclamped, andsensitivity.indices.localtakes the difference of such a target over those two values instead of2 delta p_ref, so the sensitivity of a clamped parameter is the one-sided difference it is and a target its domain does not let the design move hasNaNindices, as a target whose reference is zero has.LocalAnalysisreads the domains of the variant of every group once per run and hands them to its designs, so a model which states its domains is analysed inside them without being asked. -
The Fisher information takes the forward sensitivities of the engine (#556, #594).
fit_core.residual_jacobianasks the engine for the jacobian of the residuals of a fit at a point: the forward sensitivities of every condition, integrated next to the states by CVODES, one simulation per condition in one batch, where a difference quotient costs two simulations per parameter and condition.gaps_of_a_jacobiansays what keeps a problem from it.fisher_information(engine_jacobian=None), the default, takes the sensitivities where the engine has them and the central differences of python otherwise, with one line oflogging.infowhich says why;Truerequires them and names the gaps,Falsekeeps the differences, and astep=which is given asks for the differences of that step. It is the accuracy of a derivative which the report is read from: at the default tolerance of the integrator the quotients are a percent off in the aggregate and a hundred percent off on the small entries which the standard errors, the correlations and the rank come from, and they converge onto the sensitivities as the tolerance is tightened.FisherInformation.jacobian_ofis"sensitivities"or"central_differences"and goes intofisher.json. -
A dump of
verifysimulates with the engine of the project (#549, #595). A dump built its simulator asSimulator(n_workers=1, **tolerances), so it measured roadrunner at its default tolerances whatever the project runs its experiments with: a project of the engine core was verified on roadrunner. The experiments of a dump now run on theSimulatorSettingsof the project with the overrides of the command, the tolerances of--atoland--rtoland the engine of the new--engine NAME(roadrunner,copasi,amici,core), so a dump of two engines of one checkout is possible and a dump of a project which states tolerances takes them. The dump records which simulator it came from under the keysimulator, the engine and the settings of the integrator, andcomparereports the engine of each dump and of those settings the ones which differ, so a difference is read against the simulators it came from; a dump written before this is reported as unknown and still compares. -
A panel declares the table of its pharmacokinetic parameters (#590).
Panel.pksays that a panel states the pharmacokinetic parameters of its curves under the figure: the peak and the time of it, the area under the curve over the window of the plot and the half-life of the terminal phase, read off the curves at the state the knobs are at. It is a non-compartmental analysis of what is drawn, no fit and no model, and the renderer computes it, so the declaration is one flag.
Fixes
-
The folds of the points of a chunk are one batch per change (#550, #596). A simulation whose protocol is relative, a repeated dose which adds to the dose state, costs one segment of a simulation per change, because the executor reads the state of the model at the time of the change and folds the value of the change with it. Over the points of a scan those folds ran one after the other in the python process of the run and never reached the threads the points of the batch run on.
executor_core.requests_ofgives the request of every point of a chunk with the k-th segment of the fold of every point simulated as one batch (_Fold, a plan folded a step at a time), which the chunk of a scan and the evaluation of a fit both build their requests through. The result is the one of the points folded one by one, bitwise, and the cost of the folds of a chunk of twenty points of a multiple-dose experiment is a third of what it was on four threads. A point whose plan the executor refuses, whose formula cannot be evaluated or whose segment the engine refuses fails alone, as a point whose simulation fails. -
The experiments of a run are spread over the two pools which do not compose (#554, #597).
ExperimentRunner._workersconsulted_scan_poolonly when the run named no workers, so a run which named them got the pool of the experiments unconditionally and every scan ran serially inside its worker, because a worker starts no pool: the same work was fast or unbounded depending on how many other experiments stood beside it. An experiment whose scan the simulator would run in a pool of its own now runs in this process, with that pool and the whole machine, and the experiments which have no such scan run in the pool of the experiments afterwards, whose default size is taken from those experiments alone and which starts when there is work for it, so the two pools never run at the same time and neither oversubscribes the machine (_Spread). The table of the timings says what ran where and why. -
The executor takes the fixes of roadrunner #1430 and #1460 (#598). The build
2.12.0.dev714of libroadrunner fixes two issues the executor carried code for. An event fired at the end of a variable stepsimulatealthough its trigger is false there, one unit in the last place before its time (roadrunner #1460), so a dose at the stop before a change fired a second time after the change; it was the one strict expected failure of the tests, which is removed. And an output time was integrated from the one before it,t + (next - t), which rounds up by one unit in the last place for some times (roadrunner #1430), so a last output time one unit before the end of a segment reached the end and an event at the time of a change there fired before the change;_simulate_timesintegrates the times of the grid as they are and no longer puts a time between the last two to make the sum exact. -
The interval form of a domain clip respects the value set (#599).
clip(0.85, 1.15)of a boolean domain gave(0.85, 1.0), a pair whose lower bound the domain itself rejects, andclip(0.3, 3.7)of an integer domain gave its argument back unchanged, while the single value form has always snapped onto the values of the domain (matthiaskoenig/pkpdsim#230). Each finite bound of an interval of an integer or boolean domain is now widened onto a value the domain holds, the lower one down and the upper one up, and the widening is logged at WARNING, because a fractional span of a switch or of a count is a modelling error and not a rounding one. An interval whose bounds are reversed is still returned as it is, whichsampling.set_relative_boundsbuilds for a negative value andsampling.distributionsrefuses by name later.
Dependencies
libroadrunner>=2.12.0.dev714, the build which carries the fixes of roadrunner #1430 and roadrunner #1460 the executor relies on (#598). The builds of thedevelopbranch of libroadrunner are not on PyPI, so an install names the index of their wheels, see Installation;import sbmlsimreports an install below the floor.