Skip to content

sdbuildR v2.2.0

Choose a tag to compare

@kcevers kcevers released this 06 Jul 08:00
· 24 commits to main since this release
2f89e92

sdbuildR 2.2.0 focuses on clearer stock-and-flow diagrams, interactive plots, and more customizable visualisations. Most of the changes are meant to make models easier to inspect and use in teaching.

Highlights

Clearer stock-flow diagrams

plot.stockflow() is now more useful for reading models at a glance.

  • Equations can be shown directly in node labels and hover tooltips.
  • Equation labels now match the variable type: stocks show initial values, flows show rates, constants show values, and auxiliaries show equations.
  • Diagram layout controls are more flexible, including direction, alignment, ordering, spacing, margins, flow length, dependency arrows, fonts, and colours.

More interactive plots

Simulation, ensemble, and verification plots are easier to explore and share.

  • Time animations are now available for simulation, ensemble, and verification results.
  • Animation speed and smoothness can be tuned with control_options.
  • Ensemble and verification plots can use sliders or dropdowns to browse conditions one at a time.
  • Interactive condition controls work in exported HTML documents, including pkgdown articles and Quarto slides.

Leaner ensemble summaries

ensemble() now lets you choose which summary statistics to compute, using the same central and spread vocabulary used by the plotting methods.

  • Pick the central tendencies you want, such as mean, median, or none.
  • Pick the spread statistics you want, such as quantiles, standard deviations, ranges, or none.
  • Keep output smaller when you do not need every summary column.

A more robust Julia backend

The Julia integration should now be less fragile across package and Julia updates.

  • The sdbuildR Julia environment now lives in a persistent user data directory, so it survives reinstallations of sdbuildR.
  • sdbuildR detects when the environment was built with a different Julia version and prompts for a rebuild.
  • Julia setup messages are clearer, especially when installation is interrupted.
  • Julia simulations now respect seeds set through sim_settings().

Smoother model output workflows

Several smaller changes make model results easier to work with.

  • Data-frame methods for simulation, ensemble, and verification results can subset by variable and variable type.
  • Model print methods show saved variables more clearly.
  • The ricker() function is now available.
  • The plotting grammar for colours, line widths, and transparency is more flexible.

Breaking changes to note

Plotting argument names

Several plot.stockflow() arguments were renamed for clarity.

  • Use flow_length instead of minlen.
  • Use spacing instead of nodesep.
  • Use margin instead of pad.
  • Use color_dependency instead of dependency_col.
  • Use font_color instead of label_col.
  • Use the more general colors argument instead of stock_col and flow_col.

Simulation timing settings

In sim_settings(), output timing settings have new names.

  • Use save_by, save_times, and save_length instead of the older save_at and save_n arguments.

Ensemble plot styling

Ensemble plot styling now follows the newer central, spread, line_width, and alpha approach.

  • Older central-tendency arguments have been replaced by central and spread.
  • Line width and transparency settings now use the richer line_width and alpha grammar.

Fonts and messages

Two defaults changed or are being phased out.

  • The default diagram font changed from "Times New Roman" to "stix-two-text". Set options(sdbuildR.font_family = "Times New Roman") to restore the previous look.
  • ensemble(verbose = ) is deprecated. Use quiet for message control, which is now handled consistently across ensemble(), simulate(), use_julia(), and install_julia_env().