pypi sbmlsim 0.32.0

one hour ago

Release notes for sbmlsim 0.32.0

sbmlsim

The optimizer of a fit moves into the engine: a fit and the profiles of its identifiability run on the threads of the engine core, where the optimizer in python evaluated one point at a time and waited for the engine between its steps, and the fits of the HCTZ example run 1.4 to 7.4 times faster for it. A parallel scan of the engine core hands the engine every point a batch holds instead of a quarter of the points of the run at a time, so its threads run full. An app declares the drawing it shows and the readouts beside that drawing become its panels, and the app of a model release leads its documentation instead of sitting behind one nav entry.

Features

  • A fit and its identifiability run in the engine core (#569). sbmlsim.fit.fit_core builds the whole objective of a problem as a request of the contract fit/1: a condition per simulation group, a curve per training mapping with the weighting of the fit as the noise of its points, and the parameters in the scale of the problem. The engine runs the starts of the fit next to each other on the threads of one batch, one request of all of them, whose pool work-steals across every start instead of ending a chunk with its longest run, and it reports a run as soon as that run finished (the on_run of sbmlsim-core 0.13.0), so the progress of a long fit says how far it is and a fit which is interrupted keeps the runs which finished.

    run_optimization takes that path when the engine can run the fit (engine_fit=None, the default), True requires it and names the gaps of a fit it cannot run, False keeps the optimizer in python; profile_likelihood has engine_profiles for the same thing. A problem of another engine, of an objective of its own, of a loss function, of a residual the engine has not, or of an argument of the optimizer which is no setting of the engine fits as it did before, and the gaps are logged so a fit says why it went the other way. The residuals the engine computes from the request are the residuals the problem computes for the same parameters, every point of them (rtol=1e-9 on the iv fit of the HCTZ example), the cost of the engine at its optimum is the cost of the problem there, and the profiles of the engine are the profiles of python: the same points, the same intervals, the same classification of every parameter. The fits of the example run between 1.4 and 7.4 times faster than the optimizer in python on twenty cores, the more starts the better.

  • An app declares its figure, and the readouts of that figure become its panels (#578). AppFigure(svg, title, credit, panels) with App.figure, AppPage.figure and AppPage.shown, and panels_from_figure, which reads the sidecar <svg stem>.readouts.json of the contract figurereadouts/1 beside a drawing and builds the panels of the app from it: a key opens one panel per unit, because an axis is a unit. restrict_to_model drops the ids the compiled model does not have and names the parts of the drawing which lost them, a key whose readouts are all missing becomes a decoration which selects nothing, and _check_app refuses an app which declares a curve the model has not, naming model, variant, key path, panel and curve. The sidecar travels into a model release, and the serve payload carries the figure through AppFigurePayload, which the service, the bundle and the exported page all build; the contract stays app/1, so an older client ignores the new keys. This is the sbmlsim end of that contract, the one which turns a sidecar into the panels of an app and draws them with the renderer below; writing the sidecar belongs to the package which draws the figure, where it is not released yet, so an app of today declares its AppFigure itself.

  • The app of a model release leads its documentation (#575). The app of a release was reachable but not visible: it had one nav entry and a line in the README, while the landing page of the site and the body of the GitHub release, the two places a reader lands, never mentioned it. The landing page now introduces the app and embeds it live, after the description and before the model figure, the README invites it above the "Documentation:" line and the release notes link it, so the body of the GitHub release points at the app. The iframe and its resize script are the partial docs/_app_embed.md.j2 which the landing page and the app page both include, and it measures the body of the framed document instead of its documentElement, which inside a frame reports the height of the frame itself: the frame ends flush with the app instead of staying at 1200 px under a 941 px app. A release without an app renders exactly as before.

Performance

  • A parallel scan of the engine core fills its threads (#576). A run of the engine core is one python process which gives the engine threads, so a chunk of such a run is one batch whose points the engine spreads over its threads itself. The chunk was sized for a pool of processes, four chunks per worker so that a worker which finishes early takes another one, which left the threads of the engine a quarter of the points of the run at a time: the scan of eight points of the large model of the page Benchmarks on eight threads ran four batches of two points, two threads integrated while six idled, and the batches ran one after the other, four waves of integration where one would do. A batched chunk now takes every point the cap of a batch allows (CORE_MAX_CHUNK, which bounds the tables a batch holds at once), which takes that scan from 0.27 s to 0.13 s and the scan of 64 points of HCTZ from 13.3 ms to 11.9 ms. A scan whose chunk was already at that cap, every scan of 250 points or more, is unchanged, and the dataset a scan gives is the same bitwise however its points are chunked.

Documentation

  • the page Benchmarks is measured again (#579). The parallel scan of the large model in the engine core is 0.0982 s where the page reported 0.268 s, so the engine core now takes all five models of the page, and what is left of such a run is the slowest of its points and the assembly of the result in the one python process of the run. Two notes of the measurement are corrected with it: a thread of the engine does not integrate while python assembles, and the turns of the engines protect a comparison from a change of load which outlasts a turn, not from a burst shorter than a phase of the run.

Dependencies

  • the vendored renderer is sbmlsim-web 0.5.0, the release which draws the figure of an app: a page draws the drawing beside its grid, a click on a part of it selects the panels that part opens, the controls the panels of a page share sit in one card above the grid and an app carries an information view. The pages a model release writes carry it, so the figure an app declares is a figure a reader clicks.
  • the floor of libroadrunner is the develop build 2.12.0.dev700 (#572), which closes the last two roadrunner issues the package named, an event whose trigger is true at the end of a variable step simulate (#1445) and a delayed event in the steps of the integrator without a row of the state before it (#1446), and adds the cache of the values of the assignment rules (#1457). The strict expected failures of both issues are gone, and with the second one the accommodation underneath it: the markers of the events alone pair the rows of an event, event_pairs(rows, markers) and at_event_times(rows, markers) lost their tolerance, and two rows of equal values are two steps. The one expected failure which is left, a dose a few units in the last place before a change which fires at the end of the segment before it, where its trigger is false, is reported as roadrunner #1460 and named by that issue in the expectation and in the two places which describe the policy (#577).

Don't miss a new sbmlsim release

NewReleases is sending notifications on new releases.