Skip to content
This repository was archived by the owner on Nov 15, 2026. It is now read-only.

feat: load simulation data with --data and replay modpoll snapshots (SIM-05) - #31

Merged
gavinying merged 2 commits into
v2from
sim-05-simulation-data
Nov 12, 2026
Merged

gavinying merged 2 commits into
v2from
sim-05-simulation-data

Conversation

@gavinying

Copy link
Copy Markdown
Collaborator

Modsim 2.0.0a7: simulation data replaces scenarios, and a modpoll --export snapshot can be replayed locally. Pins modpoll-wot 0.4.0a1, which defines the format.

Breaking changes

  • --scenario becomes --data (local path or HTTPS URL); deployment devices use data: instead of scenario:.
  • --initial-file is removed; put values in a data document's initial.
  • Simulation data carries no code. Behavior scripts move to --script or a device's script: (resolved relative to the deployment), and script values to scriptParameters:.

Changes

  • Data documents and snapshots are loaded and checked by modpoll_wot.load_simulation_data; unread snapshot points keep their defaults and are logged.
  • Scaled values use modpoll_wot.scaled_raw, so values modpoll exports such as 230.10000000000002 (raw 2301, multiplier 0.1) are served again.
  • The catalog interop tool and examples read Open Modbus Catalog schema 7 (model.tm.json, model.sim.json at fd90607) and no longer read the removed vectors file. The released-runtime interop step is dropped until a release accepts --data.
  • New snapshot-replay CI job: released modpoll reads a simulated device, exports a snapshot, modsim replays it and modpoll reads the same values, scaled points included.
  • README, docs and preview notes describe --data and replay, and say snapshots of real devices stay local.

Checks

  • make check (lock, pre-commit, mypy, deptry), 113 tests, tests/test_snapshot_replay.py with modpoll 2.0.0a5, tools/generate-td.py --check and mkdocs build -s pass locally with modpoll-wot 0.4.0a1 from PyPI.
  • Modpoll's test suite (142 tests, including modsim interop) passes against this branch.

🤖 Generated with Claude Code

gavinying and others added 2 commits November 12, 2026 11:27
…(SIM-05)

- --scenario becomes --data and deployment devices use data: instead of
  scenario:. Simulation data is defined and validated by modpoll-wot
  0.4.0a1 and carries no code; behavior scripts move to --script or a
  device's script:, and their values to scriptParameters:.
- A modpoll --export snapshot is accepted as simulation data. Unread points
  keep their defaults and are logged.
- Remove --initial-file; a data document's initial replaces it.
- Scaled values use modpoll-wot's scaled_raw, so exported floats such as
  230.10000000000002 with multiplier 0.1 are served again.
- The catalog interop tool and examples read catalog schema 7 paths at
  fd90607 and no longer read the removed vectors file. The released-runtime
  interop step is dropped until a release accepts --data.
- A new CI job reads a simulated device with released modpoll, exports a
  snapshot and checks that modsim replays it unchanged, scaled points
  included.
- Version 2.0.0a7. uv.lock is updated once modpoll-wot 0.4.0a1 is published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gavinying gavinying changed the title feat!: load simulation data with --data and replay modpoll snapshots (SIM-05) feat: load simulation data with --data and replay modpoll snapshots (SIM-05) Nov 12, 2026
@gavinying
gavinying merged commit 0f24b5f into v2 Nov 12, 2026
10 of 11 checks passed
@gavinying
gavinying deleted the sim-05-simulation-data branch November 12, 2026 04:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant