pypi sbmlsim 0.38.0

one hour ago

Release notes for sbmlsim 0.38.0

sbmlsim

The parameter fit of a real model package runs in the engine core. A fit whose mappings read several models, a value at a change which the engine evaluates from its own state instead of a number which goes stale as the optimizer moves, a pointwise observable of a simulation experiment, a measurement which carries no information and every objective a fit can express, a likelihood of any noise distribution of PEtab, a noise whose scale the fit estimates or which reads the simulation and the posterior with its priors, are all fits of the engine now: every one of the 81 fit problems of pkdb_models runs there, and two ways in which such a fit could answer the residuals of another problem without an error are closed, both of them reachable on 0.37.0. Around that work the three switches of the engine reach the run layer and the records of a fit say where it ran, a Fisher information stores its decomposition so a record does not depend on the LAPACK of the machine which reads it, an identifiability analysis is bounded instead of hanging on one stuck scan, a simulation of the engine core has no wall clock deadline any more, and the fit report, the service of the panels, the app of a model and the release of a package each lose a limit of their own.

What the fit of the engine covers

The fit of a problem in the engine (the contract fit/1, sbmlsim.fit.fit_core) reached the fits of the HCTZ example of this repository and little of a model package of its size: the data of a real study is measured at the times of a shifted simulation, its protocol sets a collection or a dose by a formula at a change, its observables are formulas of its own experiments and its mappings read the builds of a model under more than one key. Every one of those is a fit of the engine now, and the two of them which the engine answered wrongly rather than refusing are closed. Measured over the 81 fit problems of pkdb_models, each built and initialized with the settings of its definition, all 81 are fits of the engine.

  • A likelihood of a fixed noise is a fit of the engine (#616, part of #613). The objective was a blanket gap in 0.37.0: only a weighted least squares ran in the engine and every likelihood and posterior kept the optimizer in python. The negative log-likelihood of a measurement is half the square of (y - m) / sigma plus a term of the scale of its noise, and that term has no derivative when the scale is a number of the data, so the optimum, the gradient and the jacobian are the ones of a curve whose noise is that scale and only the reported cost needs a shift: likelihood_constant is that shift and fixed_noise decides whether a noise is one. A log-normal noise, whose residual is the difference of the logarithms, reads log(column) off the model of the fit, written there as an assignment rule by the machinery of observable_sbml, so the engine needs no transform of its own. 27 of the 31 cases of the PEtab v2 test suite were a likelihood fit of the engine at that point, each of them the residuals of the problem bitwise, and the section below closes the rest of the objective.

  • observable_model keeps the tolerances of the fit (#616). It loads the model of a fit again from the SBML with the observables written into it and left it with the integrator settings of the engine instead of the tolerances of the FitSettings, so a fit with a formula observable integrated at a relative tolerance of 1e-6 where the fit asked for 1e-12. It carries the integrator state of the model of the problem now. This is a defect of every fit of the engine with an ObservableModel, not only of the log column of a log-normal noise, so a fit of 0.37.0 whose observable is a formula of the selections integrated at the tolerances of the engine and not at its own.

  • A curve measures at the output times of its condition (#617). A curve of a request carried the times of its data where its condition carries the output times of its plan: Plan.time_shift is applied to the time of a result on the way back and a request carries no shift, so the two frames differ by exactly the shift and the engine refused the request with the curve 24 measures at t = 36.0, which is no output time of its condition. Every fit of a simulation with a shift was out, 186 of the 522 points of the PK fit and 58 of the 166 points of the PD fit of the HCTZ model of pkdb_models lying at such times. OptimizationProblem._x_plan is the output time of every data point in the time of the plan, the merged time of merge_times, which _curve writes into the request, so the points of such a fit land on the rows of their condition and its residuals are the ones of the problem. 0.37.0 carries the defect, where a fit of the engine of a shifted simulation raises rather than falling back to python, so it fails visibly and answers no wrong number.

  • A formula at a change which reads a value the search moves is no longer folded silently (#617). A formula at a change is folded into a number by the executor by simulating the segment which ends at the change and reading the state there, so the number of a request is the one of the point it was built at: -0.5 * FLUID__na_urine of a urine collection which is halved reads a state the optimizer moves, the engine held the change where the fit started and answered the residuals of another problem without an error. Measured on the PD fit of the HCTZ model of pkdb_models at 1.2 times the fitted values, once the times of its curves were right, the cost of the engine was 326.118884821 against python's 86.1969803441, while the two agree to 1.2e-13 at the point the request was built at, which is the signature of the defect and why no check made at the start values could see it. _gaps_at_the_folds reports such a formula as the gap change_value, so the fit runs in python, and _constant_at_the_changes keeps the engine for a formula whose symbols are constants of the simulation, which folds into the same number at every point of the search. One gap is reported per formula, naming its first change and how many changes carry it, since the gaps of a problem are logged as one message, which turned the 105 gaps of the PK fit into 3.

  • A parameter whose target a value of the plan holds is a gap (#618). Plan.with_values replaces the assignment of a target wherever the plan has one, so the fitted value of a parameter lands in a change of the plan and in the pre-initialization of its steady state as well, and the engine sets the parameters of a request on the model before every simulation, which overrides the pre-initialization of a condition but not a value the plan applies later: such a parameter reached the engine frozen at the number of the point the request was built at and the engine computed the residuals of another problem without an error, with no formula needed, a plain numeric dose which the fit estimates being enough. Measured before the fix, gaps_of was empty while the cost in python moved from 60.2845 to 3138.82 and the cost of the engine sat at 8828.95 whatever the parameter. _gaps_of_the_values reports the gap parameter_value for every parameter whose target a change or the pre-initialization of a steady state of the plan sets (_held_values), one gap per parameter with its first place and the number of them, so a protocol of many doses of an estimated dose is one message.

    The fold of a change formula and the parameter whose target a value of the plan holds are released defects, which the profile of a likelihood under Fixes below is not: 0.37.0 has no gap for either of them, since it folds every formula at a change, _gaps_of_the_values read only the assignments which carry a formula and _gaps_of_the_targets never read the plan, so gaps_of called such a problem clean and its fit of the engine minimized another objective. A fit of the engine on 0.37.0 whose simulation sets an entity at a change by a formula over the state, or whose parameters estimate a target a change or the pre-initialization of a presimulation sets, should be run again on this release, which either carries that value as a form the engine evaluates or names the gap and fits in python. The fits of the HCTZ example have neither and stayed in the engine throughout.

  • A change of a linear formula is a form the engine evaluates from its own state (#618, sbmlsim-core 0.20.0). The field forms of the contract simulation/1 carries a change as constant + Σ factor * target, which the engine evaluates at the change from its own state instead of a number a fold would hold, so a collection which is halved follows the state the optimizer moves. executor_core.form_of reads the form of an assignment whose symbols are all parameters, compartments or species of the model and is_formed(plan, model) is the single predicate the request builder and the gap check share, so the two cannot disagree about what is carried; the conversion is all or nothing per plan, a plan with one formula which is no linear form folding every one of them, so a form and a fold never meet in one request. Measured engine against python on the test problem with reads_change_forms forced false to reproduce the fold: 0 at the parameter factor 1.0, the point the request was built at, against 0 with the form, 0.307 against 0 at 1.2 and 1.505 against 0 at 0.7. On the real fits of the HCTZ model of pkdb_models the largest absolute difference of a residual is 4.4e-16 at the factors 1.0, 1.2 and 0.7 for both subsets, the costs agreeing to 14 or more digits, with forms carried 33 times for PD and 101 times for PK, and both run in the engine (PD 55.4707 in 12.9 s, PK 56.8562 in 13.5 s).

    The gap change_value is what is left, decided in three ordered gates: a formula of constants of the simulation folds to the same number everywhere and is no gap, a formula the engine can carry as a form is no gap, every other one is the gap. A formula which is not linear (Aurine * Aurine), which reads a concentration ([C]), the time or the rate of a reaction is no form and still folds. time is the time of the change and no value of the model, which is why it is no term of a form: on the model of case 01820 of the SBML Test Suite, which declares an entity named time, the fold of 2 * time at the time 2 is 4 where a form over that entity reads 20. A form of a factor which is not dyadic or of three or more terms is the fold within a unit in the last place, since a form evaluates constant + Σ factor * value where apply_changes evaluates the formula as written: x / 90 becomes fl(1/90) * x, which disagrees with fl(x / 90) for about a quarter of the doubles of [1e-3, 1e3], far below the tolerance of the integrator and recorded in the known differences of executor_core, while the single dyadic factor of the real protocols is exact. _form_terms is cached on the text of the formula and the names of the entities of its model, which is all the answer depends on, so a protocol of 97 doses of one formula reads one form instead of 291: 141 ms per simulation group become 1.2 ms with a cold cache and 0.3 ms with a warm one.

  • A measurement which carries no information is no gap (#619, sbmlsim-core 0.21.0). _noise_of gives a point of the weight zero the standard deviation reference / sqrt(0), a positive infinity, which the engine refused: its residual is the difference over infinity and its row of the jacobian is zeros, so the point adds nothing to the cost and nothing to the gradient while it keeps its place in the residual vector of the request, which is what keeps that vector and the jacobian aligned with the ones of the problem. The two sources of a zero weight are a measurement of zero under ERROR_WEIGHTING, a zero baseline, and a FitMapping of the weight zero, which zeroes every point of its mapping; the weights gap is a NaN, an infinite or a negative weight now and no longer a weight of exactly zero, while an infinite weight stays a gap, its standard deviation being 0.0, which no standard deviation can be. INFINITE_NOISE_VERSION and reads_infinite_noise are the gate, in the shape of reads_change_forms: an older binding refuses the request, which _gaps_of_the_request reports as unsupported, so the gate buys a clear message and not safety.

  • A pointwise formula observable of an experiment is a column of the model of the fit (#619). A group whose data reads an observable of its experiment was always a gap. An observable whose value at a time of the data does not depend on the other output times, a Formula which is a timecourse without a reduction (OptimizationProblem._group_pointwise), is written into the model of the fit as a parameter of an assignment rule, as the observable of a PEtab problem already was: the id of the parameter carries the group (_group_observable), so two experiments which define an observable of one id with different formulas keep their columns apart, add_formula and _names_of take the names of their caller so an observable which reads another one reads its parameter and nothing of a formula is substituted as text, FormulaNode.factor is one multiplication of the parameter so the column is the value python computes, and the condition of the group selects it (_observable_column). A group whose data needs the output of its simulation keeps the gap: a value per simulation, a reduction such as max(Aurine), a PK parameter or a Custom function.

  • A fit of several models runs in the engine (#621, sbmlsim-core 0.22.0). A problem whose fit mappings read more than one model, e.g. the two builds of a model of a drug or a study which measures two species, kept the gap models and was fitted by the optimizer in python, a request of fit/1 carrying one model and a condition per simulation. A condition names the model of its simulation now: model_ids are the ids the conditions of a problem name its models by, the key of the task which reads a model and its position among the models of the problem where two experiments read different models under one key, so the ids of a request are distinct whatever the experiments are called; fit_models and loaded_models are the models and the loaded models by that id, each of them with the observables of the mappings which read it, while fit_model and loaded_model stay the model of a fit of one model; engine_fit and engine_problem are the fit and the objective of a request, LoadedModel.fit/fit_problem for a problem of one model and sbmlsim_core.fit_models/fit_problem_of_models for one of several, so a request of one model is the one of before, its conditions carrying no model; and the checks of the values at the changes and of the folds read the plan of a group against the model which simulates it (_models_of_the_groups). The parameters of a fit are the same in every model it reads, each applied to its target in the model of every condition it reaches, and the gap stays for bindings older than MULTI_MODEL_VERSION (reads_several_models), which fit one model, and for a problem whose mappings read no model at all. All 81 fit problems of pkdb_models are fits of the engine with it, against 72 before it, the nine which were left being exactly the problems whose mappings read two models (apixaban.PK, creatinine.PK, creatinine.PK_CR, creatinine.PK_CRTN, gdeobdtpa.PK, glimepiride.PK, inulin.PK, lenvatinib.PK and torasemide.PK).

  • A problem of several models says so instead of blaming the bindings (#620). gaps_of read the loaded model of a problem through _loaded_of, which answers None for a problem which has not exactly one model, and the version gate of the bindings took that None for bindings which cannot fit a request at all, so every such problem was told that the installed sbmlsim-core does not fit a request of fit/1 and that 0.12.0 is the first which does, which is false of every binding since then. The gap of such a problem is its own now and is reported before the version of the bindings, and fits_requests is asked about the loaded model of the one model of the problem. 0.37.0 gives the wrong reason for all nine of the problems above, which is a defect of the message and not of the fit.

  • 26 of the 31 cases of the PEtab v2 test suite are a fit of the engine, each of them bitwise the residuals of the problem, and 26 of the 31 are a likelihood fit of it as well. The count of 0.37.0 was 30, and four of those thirty (0016, 0028, 0030 and 0031) set a concentration at a change by a formula which reads one: such a formula is no linear form, since the parser of the math of PEtab does not read the brackets of a concentration as a term, and a fold of it holds the value where the fit started, so the gap change_value above is correct behaviour for them and they are fitted in python. The fifth has parameters which have a prior and no bounds of their own, which no optimizer of bounds can search. ENGINE_GAPS and ENGINE_LIKELIHOOD_GAPS of tests/fit/test_petab_testsuite.py record every one of the five with the code of its gap, so the count cannot drift again: between #617 and #618 neither table had been told about the four cases and the eight tests of them failed behind the marker petab_testsuite, which addopts deselects, so a normal run and continuous integration never showed it.

The objective of a fit runs in the engine

sbmlsim.fit.fit_core sent a weighted least squares and, since #616, which 0.37.0 does not carry either, a likelihood of a normal or log-normal noise whose scale the fit does not move; a Laplace noise, a noise the fit moves and a posterior kept the optimizer in python, and the jacobian of every likelihood took the central differences (#613). All four are closed (#626, the contract fit/1 of sbmlsim-core 0.24.0), so a fit which named no place runs in the engine where it ran in python before. engine_fit=False, --no-engine-fit and the field engine_fit of the spec of the kind fit keep the optimizer in python, which evaluates its points through the engine as before, and OptimizationResult.optimizer_of records where a fit ran.

  • A curve carries the distribution of its noise. The negative log-likelihood of a measurement is 0.5 data**2 + 0.5 scale**2 - 0.5 c with the residuals of likelihood_residuals, which are two rows of a curve and not one, and the likelihood of a curve of the contract is the distribution those rows are computed from (_likelihood_of, _sends_likelihood). A Laplace and a log-Laplace noise, whose residual is sign(r) sqrt(2 |r|) and no difference over a standard deviation, are such a curve. A normal or log-normal noise whose scale the fit does not move sends no field at all: its scale row is a constant of the data, so the curve is the weighted one of #616 bitwise, and likelihood_constant carries that constant onto the cost as before.

  • The scale of a noise the fit moves is a column of the model of the fit. A scale which follows the parameters of the fit, e.g. the estimated sd_obs, or the state of the simulation is no number of a curve: it is an observable of the model of the fit (_noise_entities, NOISE_PREFIX) which the curve names as its noise_column and the engine reads in the row of every measurement, exactly where python evaluates the formula. The formula is written as the math of SBML and nothing of it is substituted as text, as an observable of a formula already is: the symbol of the observable becomes a helper parameter of the linear column of the mapping, since python evaluates the noise at the linear prediction, and every placeholder a helper parameter of its one value. The PEtab v2 cases 0015, 0021 and 0024, whose noise reads an estimated parameter or a parameter of the model, are fits of the engine now.

  • A fit of the posterior sends its priors. The priors of the parameters are functions of the parameters alone, which the engine evaluates without a simulation: the prior of a parameter of its own is one row of the request (_priors_of, the kind with the parameters of PEtab, the offset which keeps the row positive, the bounds of the parameter and the normalizer, the logarithm of the mass of the prior between those bounds, which the engine subtracts from the density of its kind since a distribution function is no term of a density), and the correlated priors are one block, the multivariate normal of their scores, whose rows are the whitened scores L⁻¹ z and one more per log-normal prior. priors.untruncated_log_density is the density of a kind term for term as the engine writes it, prior_median the value the normalization is read at, where the density is largest or next to it and its logarithm loses the fewest digits, and JointPrior.offset the constant of the cost which likelihood_constant takes off a run.

  • The rows of the priors come after every row of the curves, and _residual_rows is the one map between the rows of a request and the residual vector of a problem: per training mapping its data rows and then, for a curve which sends them, the rows of the scales of its noise, and the prior rows last. residual_jacobian drops them with its rows < total mask, as fisher.data_residuals drops their residuals, so a FisherInformation stays the information of the data and the curvature of the priors belongs to the Laplace posterior.

  • The jacobian of a likelihood is the forward sensitivities. gaps_of_a_jacobian refused every likelihood, so the Fisher information of a likelihood fit took the central differences of python where a fit of least squares took the sensitivities of the engine. It has no objective branch any more: the row of the scale of a noise the fit does not move is zero whichever way it comes, which residual_jacobian leaves it, the engine answers that row itself for a fixed Laplace noise, and the scale of a noise the fit moves is a column of the model whose sensitivities the engine carries into both rows of a measurement. tests/fit/test_fisher.py pins the standard errors of the HCTZ iv fit as a likelihood against the ones of the central differences, to within 5 %, and the jacobian of a fixed Laplace noise is pinned analytically against the chain rule of its normal problem, (du/dp) / sqrt(2 |u|), rather than against a difference quotient of the cusp of a square root.

  • The rows of the data stay bitwise. The noise column of the model is the number python computes, as a column of a formula observable is, so the data rows of the engine are the data rows of the problem bitwise (numpy.testing.assert_array_equal). The row of the scale of a noise and the row of a prior are the rows whose logarithm the engine evaluates itself, ln of rust, where python evaluates the one of numpy or reads a density off the distribution of petab, an exponential followed by a logarithm: a scale row and the row of a log-normal prior agree with python to within an ulp and not bitwise (LOGARITHM_RTOL, 1e-15), the row of a prior whose bounds cut it far from its median, whose normalization is then read at the midpoint of the bounds, to within 1e-14 (measured at 3.9e-15), and every other prior row is bitwise.

  • The gate of the bindings. Neither FitRequest nor CurveRequest denies a field it does not know, so a binding before sbmlsim-core 0.24.0 would ignore a likelihood and the priors of a request and minimize another objective without an error of any kind. reads_objective compares the installed bindings with OBJECTIVE_VERSION and keeps such a problem in python as the gap bindings, so the gate buys safety and not only a message.

  • What is left of the gap objective. A placeholder of a noise formula whose value differs between the measurements of its mapping, which is no one column of the simulation; a noise formula the model of the fit cannot carry as an observable of its own, e.g. one which reads a symbol which is no entity of the model, or one which reads the observable of a mapping that is more than one curve; a measurement of a log kind which is not positive, whose logarithm is no value of a curve; a prior of a kind the engine does not evaluate, i.e. the cauchy, chisquare, exponential, gamma and rayleigh of PEtab, since ENGINE_PRIORS is the six kinds whose log density is an expression of the contract; a prior of a parameter whose unit factor is not 1, since a prior is a distribution of the value of the parameter while the engine holds the value of its target; and a prior whose support does not cover the bounds of its parameter, below.

Fixes

  • The cost of a profile point of the engine is the cost of the problem (#626). profile_points answered the cost of a point as the engine reports it, the half sum of the squares of the rows of its request, while the optimum and the threshold of an identifiability analysis are OptimizationProblem.cost_least_square: the two are likelihood_constant apart, so the points of a likelihood lay above the threshold from the first step, the crossing was interpolated between the optimum and the first point, and every parameter came out identifiable with a hairline interval. Measured on a two parameter posterior, the interval of p1 was [1.272, 1.328] against the [0.908, 1.692] of python, about fourteen times too narrow, with no error and no warning, and both parameters were still reported identifiable. A profile of a fit of least squares was never affected, the constant being zero there, which is why the comparison of tests/fit/test_fit_core.py did not see it.

    No released version of sbmlsim can produce such an interval. The defect needs a profile walked in the engine and a non-zero likelihood_constant at the same time: the walk has shipped since 0.32.0, but likelihood_constant came with #616 after 0.37.0 was tagged and no tag contains it, and every release up to and including 0.37.0 reports the gap objective for every objective which is not least squares, so the engine fitted least squares alone and there was no constant to be on the wrong side of. It is reachable only on an installation from unreleased develop between #616 and this change, and anyone in that position should run a profile of a likelihood or of a posterior fitted in the engine again; a walk in python (engine_profiles=False, --no-engine-profiles) was always on the scale of the problem. profile_points shifts the cost of a point as _fit_of shifts the cost of a run, the two places a value of the engine becomes an object of python; a jacobian keeps its rows, the constant having no derivative.

  • A prior whose density is zero between the bounds of its parameter keeps a fit in python (#626). _prior_residuals of a problem replaces the NaN of such a row with LIKELIHOOD_FAILURE_RESIDUAL, a penalty an optimizer walks out of, while the same row of a request is NaN and every run of the engine then answers a cost of NaN and the values it started from: the fit of a uniform prior narrower than the bounds of its parameter converged to the optimum in python and answered NaN in the engine. priors.prior_support is the interval the density of a kind is positive on, the lower end of a log kind the smallest positive double and not 0, and a prior whose support does not cover the bounds is the gap objective.

  • The engine_fit admonition of Parameter fitting listed a Laplace noise and a noise the fit moves as gaps of the objective, which the section above it no longer did.

Changed numbers

  • A correlated posterior shifts in its last bits. _Correlated.whitened solved L w = z with scipy.linalg.solve_triangular and now stores the inverse of the Cholesky factor and multiplies it out, i outer and j inner with one addition per j in ascending order from 0.0, no LAPACK call and no reduction of numpy, so the order of the floating point operations is fixed and the engine evaluates the same loop over the same numbers. That is what makes the whitened rows of a request and the ones of the problem comparable at all; the price is that the residuals of a correlated prior, and with them the cost of a posterior and its Laplace approximation, differ in the last bits. Unlike the profile above, this one does reach a release: 0.37.0 whitens with solve_triangular and fits a posterior with a correlated prior in python, so an upgrade from it moves those numbers. tests/fit/test_priors_whitening.py checks the product against an independent triangular solve, so the values stay the ones of L⁻¹ z.

  • A fit of a likelihood whose noise the fit moves, of a Laplace noise or of a posterior now runs its optimizer in the engine where it ran in python, so its optimum is the one of the optimizer of the engine and agrees with the one of scipy to the tolerances of the fit and not bitwise, as a fit of least squares in the engine does.

Where a fit ran is recorded, and a run can require the engine

  • The three switches of the engine reach every layer (#623). run_optimization(engine_fit=), profile_likelihood(engine_profiles=) and fisher_information(engine_jacobian=) were arguments of the python API only, so a run of the run layer or of simrun took the engine where it could and fell back to python without a word. They are the fields engine_fit of FitSpec, engine_profiles of ProfileSpec and engine_jacobian of the new JacobianSpec, which FitSpec, IdentifiabilitySpec and FisherSpec inherit, and the flags --engine-fit, --engine-profiles and --engine-jacobian of the command lines of a fit, each with its --no- counterpart, so a spec or a command requires the fit of the engine and fails naming the gaps instead of optimizing in python silently. run_fit takes engine_fit and records it in the provenance of the fit.

  • Where a fit ran is recorded with it (#623). OptimizationResult.optimizer_of and IdentifiabilityResult.profiles_of are engine or python, mixed for a result whose pieces did not all run in one place and nothing for a record of sbmlsim 0.27 or earlier, next to the jacobian_of a FisherInformation already carried; run_place of fit/options.py combines the parts of a combine, and neither field is part of the definition the parts of an analysis share, so parts which ran apart still combine. The overview of a report names where the optimizer ran and the summary of a run of the kinds carries all three. The summary of a Fisher information writes a non-finite condition number as null, as its file does, so the summary a merge returns equals the one it wrote, and the row of petab in the table of the specs of Analyses is in the table again instead of behind the paragraph of adopt.

  • The pages say which engine a fit runs on (#622). Every fit has run on the engine core since it became the default engine in 0.37.0: a problem without an engine takes DEFAULT_ENGINE, a FitDefinition without one takes the engine of the simulator of its project, and the engine simulates the residuals in the calling process and in every worker of a pool. Simulations still said that a definition without an engine takes roadrunner. Two gates a fit can hit were missing from the pages as well, a differential evolution of more than one run, whose population the engine draws from one seed, so the runs of the fit would be the same run (the gap runs of gaps_of_a_fit), in Parameter fitting, and a fit of a single parameter, whose profile point holds that one parameter and has none left to fit again (the gap parameters of gaps_of_the_profiles), in Identifiability.

A record of a fit does not depend on the LAPACK of its machine, and an identifiability analysis is bounded

  • The decomposition of a Fisher information is stored with it (#614, #523). FisherInformation computed its pseudo-inverse and its eigenvalues at every read, so the standard errors, the covariance, the correlations, the confidence intervals and the rank of a record were the ones of the LAPACK of the reader: the SVD and the eigenvalue decomposition depend on the kernels of the CPU, so a factory which writes the standard errors into its SBML did not rebuild byte for byte on another machine (0.00764768541514242 against ...44) and Project.changed_outputs, the kind factory and the rebuild check of the battery reported a change where there was none. The mechanism was reproduced before it was fixed, on a matrix of the shape of a real fit: the same matrix gives a pseudo-inverse which differs when the order of the operations changes, and with nearly collinear parameters the standard errors differ by 7e-3 relative, so this is not the last bit alone. The decomposition is stored with the information (inverse and spectrum of fisher.json) and read back, so every number derived from it is the number of the record on every machine; it is the inverse and not the standard errors which is stored, since everything a reader needs derives from it and one stored array keeps the standard errors, the correlations and the intervals consistent with each other. A record written before them has neither and computes them as before, a matrix which is changed after the information was created drops them, since they belong to the matrix they were computed from, and the Laplace posterior already stored its covariance, so it was never affected. The records of a model package are written again once, after which its rebuild is byte for byte.

  • An identifiability analysis has a timeout (#614, #522). The analysis ran its scans through FitPool.run passing neither timeout nor deadline, although the pool offers both, so a scan which never returned stopped the whole analysis with no message and no partial result and the run had to be killed from outside, observed on 35 parameters of the machine perfusion model where the same analysis in series finished in about 2 h. ProfileSettings has scan_timeout, the seconds without any scan finishing after which the scans which run or wait are given up, and timeout, the seconds after which the whole analysis is given up, which a serial analysis checks before every scan as well, so that path's jacobian pool is bounded too; both default to no limit, which is what every earlier record ran with, and both are fields of ProfileSpec of the run layer, which tests/run/test_fit_kinds.py requires of every setting of the profiles. A scan which is given up no longer raises: its parameter has no profile, the reason is recorded per parameter in IdentifiabilityResult.incomplete, the other scans run to the end and the analysis writes the profiles it has, the console logs which parameters are missing and the HTML report names them above the table, so a parameter which timed out is visible instead of silently absent. incomplete is no part of what makes two results parts of one analysis, so a part which gave a scan up still combines and a parameter which one part gave up and another profiled keeps its profile; every other exception of a scan raises as before, so a real error is not swallowed.

The engine core

  • The engine is named after its package (#616). It is sbmlsim-core everywhere it is named: the pages, the docstrings the API reference is rendered from, the tables and the figure of Benchmarks (engine_label, so the committed measurement keeps its numbers and gains its label) and the README. The value of the setting is unchanged, Simulator(engine="core") and Engine.CORE.

  • A simulation has no wall clock deadline (#616, #581). The bindings give their runtime a deadline of 30 seconds by default and nothing passed a value, so a simulation which needed longer was interrupted mid-flight with wasm trap: interrupt: the result of a simulation does not depend on the load of the machine, and with a deadline whether it completes does, so the same model with the same parameters answered on an idle machine and failed next to other work, while the work of an integration is bounded by maximum_num_steps whatever the clock does. TIMEOUT_MS is 0 now and SBMLSIM_CORE_TIMEOUT_MS gives a deadline to a caller which wants one, e.g. a service which simulates models it does not control; one runtime holds the compiled models of a process, so a deadline belongs to the process and is no setting of a Simulator, and one which fires names itself, how long it was and what to do instead of the trap.

  • The threads of a batch are measured (#615, #612). test_the_batch_of_the_engine_core_scales_over_its_threads measures the batch on its own: the requests are built once and the same batch of 1000 points runs on one, two, four and eight threads, so the numbers are of the engine and not of the python of a run. Pinned with taskset to eight performance cores of a 12th Gen Core i7-12700, one per thread, one batch of k threads reaches 88 % of two, 78 % of four and 58 % of eight, k python threads each driving a batch of one thread reach 91, 88 and 68 %, and k processes of one thread each pinned to a core of its own 100, 96 and 91 %: about 10 points of the loss are in the pool of a batch and about 23 in sharing the process, and the machine accounts for neither, which the issue had assumed it did. The hypotheses it listed were measured and are ruled out, so they need not be tried again: the speedup does not depend on the output per point (27.5k cells scale like 47.8M), overlapping the conversion of a slice with the next simulation is 3 to 10 % slower in all six A/B pairs, since the converting thread then competes with the simulation threads for the cores, SLICE_PER_THREAD of 8, 64 and 512 give 58014, 57930 and 51671 points/s on eight threads, the whole batch makes 622 mmap calls, the arenas of glibc move it by under 2 %, and the busiest cores run at 4427 MHz against 4531 MHz at one thread. What is left is in the engine and is reported as sbmlsim-core#63 with the measurement and the next step. A measurement of this has to pin, since a single thread on an E-core is 1.9 times slower than on a P-core (146.9 ms against 76.6 ms for the same batch); a pool of processes each running a single-threaded batch, which the numbers imply, costs 0.9 to 1.1 s per worker and 0.18 s to compile the model in each, so it breaks even around 150000 points per session and is not worth doing on today's numbers.

  • Three benchmarks of the scan core name roadrunner (#615). test_a_simulation[repressilator], test_a_simulation[midazolam] and test_the_serial_time_of_a_scan_of_1e3_points compared Simulator.simulate and Simulator.run with executor.execute, the executor of roadrunner, through a simulator of the default engine, which is the engine core since 0.37.0, so they have measured the python of the scan core against another engine's executor since then and failed with +2627 %, +3200 % and +292 % against a budget of 5 %. They name roadrunner now (roadrunner_simulator), which is what they compare against, so pytest -m benchmark -n 0 -s tests/simulator/test_benchmark.py is 6 passed where it was 3 failed, 3 passed; the marker is deselected by default, which is why continuous integration never showed it. The two benchmarks of the pool measure whether parallelism pays at all and keep the default engine.

The reports, the service, the app and the release

All five come with #616 and are independent of the engine work above.

  • Every study of a fit report is visible (#511). The figure legend of the summary plots was one column which did not grow the figure, so a fit of 35 studies showed 29 of them and cut the rest and the entries of the band with them, and the colors of the studies cycled through nine, so the first, the tenth and the nineteenth study shared one and could not be told apart in a panel. The legend takes as many columns as it needs to fit the height of the figure, the figure grows by what the legend needs beyond the width the panels keep free for it, so the panels keep their size, and it grows in height rather than cut an entry. category_color gives the categorical colors while they are enough, so a report of few studies keeps its colors, and samples as many colors as there are categories from turbo beyond them, which varies the hue and the lightness, so the neighbours of a large sample are told apart.

  • The service keeps its bounds and its event loop (#521). The slot of the runner was released when the scan returned, before the body of the answer was built, so one model could hold about twice the threads its bound allows while the answers were built: PanelRunner.admitted is public and re-entrant per thread, and the simulate route holds it over the run and over the body. A cache hit served the response model, which FastAPI serialized on the event loop for every hit, about 0.28 s of a blocked loop at the declared limits: the cache keeps the encoded body (encode_response), the body of a miss is encoded in the thread of its request and inside that bound, and both routes answer the bytes as they are, so the loop serializes nothing and the bound of the cache measures the bodies it serves instead of estimating the objects it kept.

  • An app declares the scenarios of a variant (#524). The scenarios of an app were declared per page and checked against the knobs of every variant, so a model whose builds offer different stops of a knob, e.g. the renal function of the studies of each build, could only declare scenarios of values every build offers, and a scenario named after a study of one build was shown on the page of the other. AppVariant.scenarios is the scenarios of a page in that variant, by the id of the page, which replace the ones the page declares, and App.scenarios_of(variant) is the one place they are resolved, which the delivery and the checks of the service share, so a scenario is checked against the knobs of its own variant and the app route answers the scenarios of the variant it serves, which is what a shell reads. The contract app/1 takes the field additively, the pages keep theirs, and every variant of the body carries what it declares, so a shell can show what another build offers without fetching it.

  • A figure group which is too large is split (#591). panels_from_figure refused a key with more than MAX_CURVES readouts of one unit and group, which the liver of a model of about six substances reaches, and refused it while the declaration of a package was being built, so such a model had no figure app and no way to ask for one. A part of more than that many readouts becomes several panels of at most that many curves, numbered after the id of the part (li_plasma_1) with the title saying which one it is (Liver, plasma (1 of 2)). The limit stays and a part which fits keeps the id and the title it had.

  • A release checks the citation of its app (#525). An App cites its release in its footer with an explicit year, so the footer does not change on New Year, and nothing raised that year with a release in a new one: the README would cite 2027 while the footer kept 2026. prepare_release refuses a project whose app cites something other than the citation of this release, before anything is built, and names both (_check_app_citation).

Dependencies

  • sbmlsim-core>=0.24.0, the release whose curve of fit/1 reads the likelihood of its measurements and the column of the scale of a noise the fit moves, and whose request reads the priors of its parameters and their prior_correlation. Neither FitRequest nor CurveRequest denies an unknown field, so an older binding would ignore the block and minimize another objective: the floor is raised and reads_objective gates the fields on top of it, the way reads_after_change and reads_derived gate theirs, so an environment which is older than the floor says so instead of answering the wrong numbers.

  • The floors on the way to it, each of them with the lock, where 0.37.0 locked sbmlsim-core>=0.18.0: 0.19.0 (#616), which divides the residual of a measurement by its standard deviation instead of multiplying it by the reciprocal (sbmlsim-core#64), so the residuals and the cost of a fit of the engine are the ones of the problem to the last bit for a noise which is no power of two, which is every likelihood (0.9 / 2.5 is 0.36 where 0.9 * (1.0 / 2.5) is 0.36000000000000004; the suites agreed before because their measurements carry the deviation 1), and whose native engine answers every call of the bindings (sbmlsim-core#65), so the initial values of a DAE or delay model and the plan of a prepared request come from the engine which runs them; 0.20.0 (#618) for the forms of a change of simulation/1 (CHANGE_FORMS_VERSION), which an older binding fails on rather than ignoring, since Change denies unknown fields, so that gate buys a clear message and no safety; 0.21.0 (#619) for the infinite standard deviation of a measurement which carries no information (INFINITE_NOISE_VERSION); and 0.22.0 (#621) for a condition which names the model of its simulation (MULTI_MODEL_VERSION), which is what a fit of several models needs.

  • The releases of the libraries of the day, each of them with the lock. pymetadata>=0.9.0 moves pymetadata.omex onto pymetadata-core, a Rust extension, so pymetadata is no longer pure python and neither is the dependency tree of sbmlsim, which reads and writes the COMBINE archive of a release through it (sbmlsim.release.archive). What it buys is speed: reading an archive is about 8 to 25 times faster and writing one faster still, since a read no longer extracts the archive into a temporary directory and a member nobody touched is copied compressed instead of being inflated and compressed again. The public API of Omex, Manifest and ManifestEntry is unchanged and the one behaviour change which reaches a caller is compatible with what a caller catches, a PasswordError where zipfile raised a RuntimeError, which is a ValueError. What it costs is the install on a platform without a wheel: pymetadata-core ships one abi3 wheel per platform, which every CPython from 3.11 on installs, for linux with glibc on x86_64 and aarch64, macOS on x86_64 and arm64, and win_amd64, and on every other platform, i.e. musl based linux such as Alpine, linux on armv7, ppc64le or s390x, FreeBSD, 32 bit or ARM windows, or an implementation other than CPython such as PyPy, pip install falls back to the source distribution of the core and compiles it, which needs a Rust toolchain, i.e. cargo, and fails without one. The five platforms with a wheel are the ones the tests and the documentation of sbmlsim run on, so nothing of this release changes for them. pkpdutils>=1.7.1 is the floor which lets the rust kernel of the non-compartmental analysis resolve, pkpdutils-core>=0.7.0,<0.8 where 1.7.0 still required <0.7; nothing of pkpdutils itself changes. And the vendored sbmlsim-web of the web app of a model is 0.7.0 (scripts/web_assets.py, its VERSION.json and the checked integrity of the tarball), the release which draws the table of the pharmacokinetic parameters under the figure of a panel which declares Panel.pk - the peak, its time, 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 - so the flag 0.35.0 declared has the renderer it named. The floor of sbmlsim-core is the one above.

Don't miss a new sbmlsim release

NewReleases is sending notifications on new releases.