Release notes for sbmlsim 0.23.0
The long runs of sbmlsim say what they are doing. A fit, an identifiability, a scan and a run of simulation experiments report their activities through one API, with a bar in a terminal, a line in a log or an event in a file, and the bar carries the elapsed time, the estimate of what remains, the cores and the memory of the run. A fit of hours used to print nothing at all, so no estimate of its runtime was possible.
Results which change: none, but the distribution of the draws of a parameter whose standard error covers its bounds, which is the uniform of the bounds now instead of a lognormal which no sampler can draw from.
Features
- One progress report for the long runs (#509). The package
sbmlsim.progressholds the activities of a run as a tree (activity(),step(),remaining()as the one batch aware estimate of what is left) and the reporters which show them:BarReporterin a terminal,LogReporteras a line every 30 s andEventReporteras theprogressevents of aprogress.jsonl.sbmlsim.progress.resourcesreads the cores, the CPU and the memory of the process tree and of the machine from/proc, so the bar says what the run uses; a platform without/procor the moduleresource, i.e. windows, reports what it has. Instrumented are the runs of experiments, the points of a scan, the runs of a fit and the points of their jacobians, the scans of an identifiability and their points, and the figures of a fit report. The mode is--progress auto|bar|log|noneofpython -m sbmlsim.run, the environment variableSBMLSIM_PROGRESSor the argumentshow_progresswhere a call has one;autois a bar on a terminal, a log elsewhere and nothing in a test. - The workers of a fit report to the reporter of the parent (#510). An activity a worker opens, the points of the scan of an identifiability, was reported to nothing: the reporter lives in the parent and a worker is a process of its own.
FitPoolhands every worker a queue when it starts (sbmlsim.progress.workers,QueueReporter,worker_progress, theinitializerofsbmlsim.parallel.start_pool) and a thread of the parent forwards what arrives as a child of the activity the tasks are handed out in. A pool which restarts after a crash hands the queue over again, so the progress does not go quiet with the first dead worker; a run without a reporter creates neither queue nor thread. The throttle of the log is global, so two lines stay an interval apart whatever runs: 16 workers which each open a scan wrote 16 lines at once. - The README and the site of a release show the diagrams of the models (#513). The release copies every SVG which the factory writes beside its models into
models, e.g. the schematic<stem>.svgand the anatomy<stem>_body.svgof a model of the PBPK library of pkpdsim. The README gets a section Model with the overview figure (figures/<name>_model.png, now also.svg) and the diagrams, the home page of the site shows them as well, and the models page shows at each model its figure and its diagrams (an SVG belongs to the model with the longest stem which is its name or the start of its name followed by_).ModelEntry.figurebecomesfigures, a tuple, andDiagramis new. A release whose factory writes no figure removes the figures of the earlier release, so no README and no page shows a figure which the prune deletes.
Fixes
- A standard error which covers the bounds of a parameter is a uniform (#512). The Fisher information of a rank deficient fit gives a standard error far wider than the bounds of its parameter, and the lognormal of such a sigma is no number: a model of pkdb_models with a parameter at 6.6e-4 and a standard error of 456 could not be built at all (
OverflowError: math range errorinmath.expm1(sigma**2)).ParameterUncertainty.distribution()writes the uniform of the bounds when the standard deviation covers them, on a logarithmic scale whensigma_lnreaches the spanln(ub/lb)and on the linear scale when it reachesub - lb; a truncated distribution that wide is flat over the bounds anyway, so this is what the draws of a parameter the data do not constrain are, and the provenance of the parameter says so.distribution_from_formularefuses a lognormal aboveMAX_SIGMA(26.0, where the variance stops being a number) with a message which names the uniform instead of the overflow of the sampler. - The pool of a fit is stopped and its forwarding thread closed.
worker_poolofsbmlsim.fit.runnerleft theExitStackof the thread which forwards the activities of the workers open, so a fit which restarted its pool kept the forwarding of the pool it started with. The pool is stopped first and the stack closed after it, so no event of a worker is lost. - A reporter is no longer dropped for the address of another.
report()remembered a failing reporter byid(target)in a set, and python gives the address of a freed object to the next one, so a reporter created later could land on it and was then never called, e.g. a bar which never appeared. The dropped reporters are kept by their id as the value.
Dependencies
simrun>=0.3.2of thesimrunextra, the latest release of simrun, which the lock resolved already (#507).