CaltechExperimentalGravity / CaltechExperimentalGravity/system_ident
Stage A: fake CDS transport test harness (awg/cdsutils/gpstime stubs)
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
**Stage A of the plan — unblocks every other issue in this campaign. Do this first.**
Add `tests/_fake_cds.py`: `sys.modules` stubs for `awg` / `cdsutils` / `gpstime`. None of the three is
installed on the dev machine, so every CDS test must fake them. Model on the existing
[`MockRTSModel` (tests/test_rtsfreerun_backend.py:35)](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/tests/test_rtsfreerun_backend.py#L35).
Required behaviours:
- **`FakeArbitraryLoop`** — record `(channel, array, rate, start, ramptime)` and count **construction**,
`start` and `stop` at class level. Tests must be able to assert *the loop was never constructed*, not
merely that `.start` was not called: a safety gate that constructs the object and then declines has
still reached the AWG API.
- **`FakeGetdata`** — return objects exposing `.data` / `.sample_rate` / `.start_time`, driving an
`lfilter`ed plant, with a **settable GPS offset** so period misalignment is directly testable, plus
switches for short reads, gaps, and a missing channel.
- **`FakeGpstime`** — a controllable clock, so no test ever sleeps a real `start_buffer`.
Self-test: the fake plant's `freqz` must match the FRF the loop recovers from it.
Why it comes first: both hard physics problems (spec §2) and the entire safety story are settled with
numbers on this harness, off-hardware, before any hardware time is requested.
---
**Campaign:** CDS hardware backend · branch [`feat/cds-hardware-backend`](https://github.com/CaltechExperimentalGravity/system_ident/tree/feat/cds-hardware-backend)
· [spec](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/docs/superpowers/specs/2026-08-03-cds-hardware-backend-design.md) · [plan](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/docs/superpowers/plans/2026-08-03-cds-hardware-backend.md) · [handoff](https://github.com/CaltechExperimentalGravity/system_ident/blob/feat/cds-hardware-backend/notes/cds-hardware-bringup-2026-08.md)
*Code is deferred until the plan and issues have been reviewed.*
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading tests/test_rtsfreerun_backend.py around MockRTSModel, then create tests/_fake_cds.py as specified in the issue. Done means the AWG, getdata, and gpstime fakes expose the listed counters, controls, and failure modes, and the fake plant’s freqz matches the recovered loop FRF without real hardware or sleeping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100