nbs-sim provides a configurable EPICS simulation IOC for NBS beamline environments.
It builds a caproto-based IOC from startup configuration files and simulated device
classes so UIs and orchestration systems can be exercised without hardware.
- Loads simulated devices from configuration
- Exposes PVs through a caproto IOC.
- Supports startup from a profile startup directory or explicit config file paths.
- Includes simulation device classes for motors, shutters, detectors, optics, and beamline-specific components.
- Python
>=3.8 - Runtime dependencies from
pyproject.toml:caprotoscipynumpynbs-blnbs-core
pip install -e .If you use pixi in this monorepo:
pixi install
pixi run python -m pip install -e .The CLI entrypoint is nbs-sim.
Point to a startup directory that contains:
devices.tomlsim_conf.toml
nbs-sim --startup-dir /path/to/startup --list-pvsnbs-sim \
--device-file /path/to/devices.toml \
--config-file /path/to/sim_conf.toml \
--list-pvsIf neither --startup-dir nor both config file options are provided, startup exits
with a CLI error.
nbs_sim.beamline:mainparses CLI arguments and loads device configuration.generate_device_configmerges the device and simulation configuration files.loadFromConfiginstantiates devices withcreateIOCDevice.- The IOC is started with caproto
run(...).
Install development tools:
pip install -e ".[dev]"Run tests:
pytestFormat and lint:
black src
flake8 srcsrc/nbs_sim/beamline.py: CLI entrypoint and IOC assembly.src/nbs_sim/load.py: device factory helper used by autoload.src/nbs_sim/devices/: simulation device implementations.
- Project status is currently alpha.
- This package expects configuration files generated or maintained by the broader NBS beamline stack.