Commands

MicroBenthos provides a command line interface for its operations under microbenthos.

Usage: microbenthos [OPTIONS] COMMAND [ARGS]...

  Console entry point for microbenthos

Options:
  -v, --verbosity                 Set verbosity of console logging
  --logger <TEXT INTEGER RANGE>...
                                  Set specified logger to loglevel (example:
                                  microbenthos.model 20)

  --version                       Show the version and exit.
  --help                          Show this message and exit.

Commands:
  export    Export options
  setup     Setup configuration
  simulate  Run simulation from definition file

To view the log messages on the console, use the -v flag. For increased verbosity of console log messages, use it multiple times, e.g. -vv, -vvv, etc.

The various subcommands available are:

Command: simulate

$ microbenthos simulate --help
Usage: microbenthos simulate [OPTIONS] MODEL_FILE

  Run simulation from definition file

Options:
  -o, --output-dir DIRECTORY      Output directory for simulation
  --output-same                   Output to same location as definition file
  -x, --exporter TEXT             Add an exporter to run. Form: -x <name>
                                  <export_type>
                                  ["<option1>=val,<option2>=val2"]

  -sTime, --simtime-total TEXT    Total simulation time. Example: "10h"
  -sLims, --simtime-lims TEXT     Simulation time step limits. Example: "0.1
                                  500"

  -sSweeps, --max-sweeps INTEGER RANGE
                                  Max number of sweeps of equation in each
                                  timestep

  -sRes, --max-residual FLOAT     The max residual allowed for the time steps
  -sSolver, --fipy-solver TEXT    Solver type to use from fipy
  -sSnapshot, --snapshot-interval INTEGER RANGE
                                  Interval in seconds between simulation
                                  snapshots

  -O, --overwrite                 Overwrite file, if exists
  -c, --compression INTEGER RANGE
                                  Compression level for data (default: 9)
  --confirm / -Y, --no-confirm    Confirm before running simulation
  --progress INTEGER RANGE        Show progress bar (0 to disable)
  --progress-tag TEXT             Tag for progress bar
  --plot / --no-plot              Show graphical plot of model data
  --video / --no-video            Save video of simulation plot. This can slow
                                  things down.

  --frames / --no-frames          Save frames of simulation plot. This can
                                  slow things down.

  --budget                        Track variable budget over time and show in
                                  plot

  --resume INTEGER                Resume simulation by restoring from stored
                                  data at time index

  -eqns, --show-eqns              Show equations that will be solved
  --help                          Show this message and exit.

Note

By default, a progress bar exporter and model data exporter are added if not specified. The progress bar can be turned off using the --no-progress switch.

Command: export video

$ microbenthos export video --help
Usage: microbenthos export video [OPTIONS] DATAFILE

  Export video from model data

Options:
  -o, --outfile FILE        Name of the output file
  -O, --overwrite           Overwrite file, if exists
  --from-time TEXT          Clock time to start video ("5 h" or "0.25 d" or
                            "0.45 day")

  --till-time TEXT          Clock time to end video ("5 h" or "0.25 d" or
                            "0.45 day")

  --style TEXT              Plot style name from matplotlib
  --writer TEXT             Animation writer class to use
  --figsize TEXT            Figure size in inches (example: "9.6x5.4")
  --dpi INTEGER RANGE       Dots per inch for figure export
  --show                    Show figure on screen during export
  --budget                  Show temporal budget error of variables
  --fps INTEGER RANGE       Frames per second for export (default: 10)
  --bitrate INTEGER RANGE   Bitrate for video encoding (default: 1400)
  --artist-tag TEXT         Artist tag in metadata
  --progress INTEGER RANGE  Position of progress bar
  --help                    Show this message and exit.

Note

The graphical exporter in MicroBenthos uses matplotlib to render the plots and animations. For video export, ffmpeg or one of the other animation backends for matplotlib.animation should be available.

Command: export model

$ microbenthos export model --help
Usage: microbenthos export model [OPTIONS] MODEL_FILE

  Load a model from a file and export it after validation.

Options:
  --key TEXT     Load this key from the input file
  -v, --verbose  Set this to see verbose output
  --help         Show this message and exit.

Command: setup completion

$ microbenthos setup completion --help
Usage: microbenthos setup completion [OPTIONS]

  Setup CLI completion for shell

Options:
  --shell TEXT  The shell to install completion  [required]
  --show-code   Show the installed code
  --help        Show this message and exit.