bloc.core.cli#

Bloc CLI — wraps Boulder’s CLI with BlocRunner as the default runner.

Usage:

bloc foo.yaml                      # launch the GUI (Run Sweep is the
                                   # "Run Simulation" split button's caret)
bloc foo.yaml --sweep              # GUI, run-set already running on load
bloc foo.yaml --sweep --headless   # headless: run the whole scenario/sweep
                                   # run-set and write the collection store
bloc foo.yaml --headless --download out.py
bloc foo.yaml --trajectories       # GUI + the Trajectory Dashboard (analysis)
bloc validate foo.yaml
bloc describe TubeFurnace

Every flag supported by boulder is accepted; the only difference is that Bloc’s converter and normalisation pipeline are used automatically.

Analysis toolbox#

--trajectories is a Bloc analysis toolbox extension (not a Boulder flag): it launches the GUI and, once the GUI’s port is up, the bloc.plotting.trajectory_dashboard (a stability-map of every cached scenario’s reactor trajectory, clickable to load a scenario in the GUI). It is stripped from the argv before delegating to Boulder, so Boulder never sees it.

--sweep is implemented in Boulder’s CLI (a generic flag); it delegates to the host-registered BoulderPlugins.sweep_runner — which Bloc points at boulder.sweep_runner directly here (BoulderPlugins.converter_class is what makes it resolve Bloc’s mechanisms correctly, see bloc.boulder_plugins.register). GUI mode (default, no --headless): --sweep opens the GUI with the “Run Simulation” split button defaulted to “Run Sweep” and auto-started — no click needed (since parks4/boulder#109; older Boulder releases only defaulted the button without running it). --sweep --headless is the true headless equivalent of the GUI’s Run Sweep action, no GUI: expand the config’s scenarios: / sweep: blocks, solve every run, and serialize each into the collection store (metadata.extra.scenario_store or <config-stem>_scenarios.h5), printing scenario N/M progress. No server. See models/README.md for worked examples.

Authentication#

When the five CLOUD_* environment variables are present (CLOUD_TENANT_ID, CLOUD_CLIENT_ID, CLOUD_CLIENT_SECRET, CLOUD_REDIRECT_URI, CLOUD_SECRET_SESSION), Boulder’s ASGI app is wrapped with Microsoft Entra ID authentication before uvicorn starts. The module-level app attribute in boulder.api.main is patched in-place; uvicorn resolves the string target "boulder.api.main:app" from the already-imported module, so it picks up the wrapped app automatically.

Set SKIP_AUTH=true to bypass authentication (CI / local dev without Azure credentials).

Functions#

main([argv])

Entry point for the bloc console script.

Module Contents#

bloc.core.cli.main(argv=None)#

Entry point for the bloc console script.