Release notes for sbmlsim 0.39.0
Two things which were written but not reachable: the polynomial chaos expansion had no analysis of the sensitivity runner to drive it, and the integrator factor of the credibility verification compared a run with itself because the engine dropped the setting which makes the second method a second method. Both are closed here, and the decomposition which is the cost of a chaos expansion is now taken once per scan instead of once per candidate degree and observable.
A ChaosAnalysis for the sensitivity runner
sbmlsim.sensitivity.pce was implemented, documented and tested, and no analysis of the runner drove it: a project could not run the one method which gives the indices for a few hundred points instead of n (d + 2). ChaosAnalysis reads a latin hypercube sample into an expansion and writes S1, ST and, where second_order is on, S2.
choose_truncation picks q and max_interaction from the dimension of the model, the degree and the number of points when the analysis is given neither, instead of handing the user the ValueError of a basis which is too large on the first run: the full basis, then q 0.75, 0.5, 0.5 with pairs alone, and the additive basis last, the first which fits the budget of POINTS_PER_TERM points per term. A run which chooses logs what it chose, and an analysis which is given q keeps it.
_GlobalAnalysis._run wrote S1 and ST alone, so the loo, degree, mean and sd which pce computes per element were dropped - the very variables which make a fit the points do not support visible rather than silent. The analyses carry the variables they write and a hook for the files beside them now, and ChaosAnalysis writes quality.tsv next to the indices.
One decomposition, for every candidate and every observable
The design matrix of the basis and its QR are the cost of the method, and they were taken again for every candidate degree and again for every observable of a scan. They depend on the points and the basis alone.
The candidates of fit_chaos are prefixes of the basis of the largest degree, and the thin QR of the first k columns of a matrix is the first k columns of its Q and the leading k by k block of its R, so one decomposition serves every candidate; sensitivity.supported is the budget of points per term which decides the largest one. The values never enter it, so pce decomposes once and fits every observable of the scan with it.
Measured on the shape of the HCTZ model (22 parameters, 2048 points, the basis of the degree 4 with q=0.75 and pairs, 782 terms, 11 observables of 6 elements): the fits took 4.2 s and take 1.45 s, 2.9x, three passes on an idle machine agreeing within 2.8x to 3.0x; a whole analysis of that shape went from about 31 s to about 13 s over the two steps. The expansions are bit identical. Of one fit, 0.12 s is the design matrix and 0.08 s its QR (2048 by 782 at 20 to 33 GFLOP/s through the OpenBLAS of NumPy), which is what the sharing removes ten times over.
The factor integrator of the verification is a check again
The check reintegrates every adopted fit at the tightened tolerances with the BDF of CVODE capped at SECOND_METHOD_ORDER, so that a difference which is the choice of the solver and not the model becomes visible. The engine had no equivalent of maximum_bdf_order and dropped it, so the second method was the first method: verification.tsv gave integrator the differences of tolerances to the last digit and both were reported as verified, a factor numerical_solver_error which no run bounded. It held for every model on the default engine.
sbmlsim-core 0.25.0 takes the order of the method, the smallest step and the settings of the error test and of the nonlinear solver, so maximum_bdf_order, maximum_adams_order and minimum_time_step are settings of the engine now (REQUEST_SETTINGS) and no longer ignored. An order is a whole number which is not negative, as the u8 of the request is, and 0 is the default of the solver.
An engine which drops the setting makes the check impossible, and a check which degrades silently is worse than one which is missing: COPASI and AMICI take the portable settings alone, and their models would integrate the alternative as they integrate the reference. takes_integrator_setting of a model answers for its engine, second_method_reason names the models which drop the setting, and the verification carries it in not_applicable: the check is not made, the context gets no record of it, as it gets none of a check of the battery which is not applicable, and the factor numerical_solver_error stays not_assessed.
A model of the default engine therefore reports an integrator check which was integrated with a method of another order, and a report of a verification made before this release which shows integrator equal to tolerances to the last digit was that defect; it is worth running again.
Dependencies
-
sbmlsim-core>=0.25.0, the release which takes the settings of CVODE and of IDA (the order of the method, the smallest step, the bounds of the error test and of the nonlinear solver, the detection of the stability limit) and reports the state the solver ended in. The engine of 0.25.0 integrates a request which names none of them exactly as 0.24.1 did; what changed besides the new settings is that the block of settings is applied at every initialization with the documented default of SUNDIALS instead of only when a value was not zero, so a capped order no longer leaks from one simulation into the next on a reused solver memory.A package which vendors the runtime of the engine into committed assets has to write them again when it takes this release: the version of the core is part of what they carry, and a test which compares them against the installed release fails until they are regenerated. In sbmlsim nothing is vendored; downstream, pkpdsim's browser exports and the web apps of pkdb_models are, and regenerating them moves their version strings and the wasm binaries alone (verified leaf by leaf against sbmlsim-core 0.25.0: every precomputed course and every compiled model description is identical, and the compiler of 0.25.0 emits byte for byte what 0.24.0 emitted).