Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

scpi-lab-sim

CI

A small, fully synthetic SCPI-style instrument simulator and conformance checker for practicing lab-automation code without hardware.

中文说明

What this is

  • A tiny command parser that normalizes short/long SCPI-style headers.
  • A stateful, vendor-neutral instrument simulator (OUTPUT, SOURCE, BURST, MEASURE).
  • Deterministic synthetic measurements: no real device, no customer data, no measured values.
  • A CLI with repl, check, and demo modes.
  • A conformance check that reproduces a common real-world bug: burst state leaking from a burst waveform into a later non-burst waveform.

What this is not

  • Not a full SCPI implementation.
  • Not a driver for any real instrument or vendor.
  • Not derived from employer code, internal ATE formats, course material, or private test data.

Install and run

Requires Python 3.10 or newer.

python -m pip install -e .
python -m scpi_lab_sim check
python -m scpi_lab_sim demo
python -m scpi_lab_sim repl

Example check output:

[PASS] identity query: SCPI-LAB-SIM,1.0,0,SYNTHETIC
[PASS] output state: on=True, off=False
[PASS] burst reset on plain generation: after setup=True, after generate=False
[PASS] deterministic measurements: -0.001000, 0.099967, 0.199635
[PASS] invalid argument rejected: CommandError raised
5/5 checks passed

In the REPL, try:

scpi> *IDN?
SCPI-LAB-SIM,1.0,0,SYNTHETIC
scpi> SOUR:FUNC RAMP
OK
scpi> MEAS:VOLT?
0.000657
scpi> quit

Project layout

src/scpi_lab_sim/
  parser.py     # command normalization and validation
  device.py     # simulated instrument state and command execution
  checks.py     # built-in conformance checks
  cli.py        # argparse-based CLI
tests/          # unit and CLI tests
.github/workflows/ci.yml

Development

python -m pip install -e ".[dev]"
ruff check .
ruff format --check .
python -m pytest
coverage run -m pytest
coverage report

Honesty note

This repository was created in November 2026 with AI assistance for scaffolding, tests, and documentation. It is a synthetic practice project, not a claim of prior production use, hardware certification, or independent authorship of any historical exercise. No employer source code, real instrument data, or unpublished course material is included.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages