Skip to main content

NBS Simulation IOC Generator

Project description

nbs-sim

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.

Features

  • 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.

Requirements

  • Python >=3.8
  • Runtime dependencies from pyproject.toml:
    • caproto
    • scipy
    • numpy
    • nbs-bl
    • nbs-core

Installation

pip (editable)

pip install -e .

pixi

If you use pixi in this monorepo:

pixi install
pixi run python -m pip install -e .

Running the IOC

The CLI entrypoint is nbs-sim.

Option 1: startup directory

Point to a startup directory that contains:

  • devices.toml
  • sim_conf.toml
nbs-sim --startup-dir /path/to/startup --list-pvs

Option 2: explicit file paths

nbs-sim \
  --device-file /path/to/devices.toml \
  --config-file /path/to/sim_conf.toml \
  --list-pvs

If neither --startup-dir nor both config file options are provided, startup exits with a CLI error.

How it works

  • nbs_sim.beamline:main parses CLI arguments and loads device configuration.
  • generate_device_config merges the device and simulation configuration files.
  • loadFromConfig instantiates devices with createIOCDevice.
  • The IOC is started with caproto run(...).

Development

Install development tools:

pip install -e ".[dev]"

Run tests:

pytest

Format and lint:

black src
flake8 src

Package layout

  • src/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.

Notes

  • Project status is currently alpha.
  • This package expects configuration files generated or maintained by the broader NBS beamline stack.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nbs_sim-0.2.2.tar.gz (214.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nbs_sim-0.2.2-py3-none-any.whl (222.3 kB view details)

Uploaded Python 3

File details

Details for the file nbs_sim-0.2.2.tar.gz.

File metadata

  • Download URL: nbs_sim-0.2.2.tar.gz
  • Upload date:
  • Size: 214.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nbs_sim-0.2.2.tar.gz
Algorithm Hash digest
SHA256 2577427f5c96b5500c7624c0a9ebff920c039b156d13d0660669c75781cdc71e
MD5 411dd6dcb35698b8997a039bd8610413
BLAKE2b-256 56084530abb6a3a44f363fa7b6e1aed4e6a48a1e5495fc4edc32ac90de96b023

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbs_sim-0.2.2.tar.gz:

Publisher: python-publish.yml on xraygui/nbs-sim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nbs_sim-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: nbs_sim-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 222.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nbs_sim-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0b3097141b7b14397db46c1162fc98e70ce82b09f8d3c918038e6e3b32b6e324
MD5 0425f33697d860e9a2c3aef6ac17ba52
BLAKE2b-256 662bf5d4205ae14109c792028bc633625203c1e984c38ff1046afaff645a10f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for nbs_sim-0.2.2-py3-none-any.whl:

Publisher: python-publish.yml on xraygui/nbs-sim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page