Skip to content

Generalize PV names#29

Draft
Max Rakitin (mrakitin) wants to merge 3 commits into
configurable-zebra-dataset-mapfrom
generalize-pv-names
Draft

Generalize PV names#29
Max Rakitin (mrakitin) wants to merge 3 commits into
configurable-zebra-dataset-mapfrom
generalize-pv-names

Conversation

@mrakitin

Copy link
Copy Markdown
Contributor

This is a follow up PR to #28 to make the PV names more generic.

I suggest we merge #28 first and cut a release, and then will rebase/merge this PR and create a next release with backward-incompatible changes (with minor version bump).

Max Rakitin (mrakitin) and others added 3 commits June 8, 2026 22:04
Replace 8 hardware-specific PV attributes (enc1/enc2/enc3/zebra_time,
i0/im/it/sis_time) with 4 generic channels (ch1-ch4) shared across both
dev types. The dev_type PV already distinguishes zebra vs scaler, so one
set of 4 generic channels is sufficient.

HDF5 dataset name *values* in _DEFAULT_DATASET_MAPS are unchanged:
  - zebra:  ch1->enc1, ch2->enc2, ch3->enc3, ch4->zebra_time
  - scaler: ch1->i0,   ch2->im,   ch3->it,   ch4->sis_time

This enables reuse across beamlines (e.g. FXI, issue #27) via partial
--dataset-map overrides such as:
  --dataset-map '{"ch1": "enc1_pi_r", "ch2": "zebra_time"}'

Changes:
- caproto_ioc.py: replace 8 pvproperties with ch1-ch4, update default
  maps and CLI help text
- ophyd.py: replace 8 Cpt components with ch1-ch4
- tests/conftest.py: update custom_map fixture keys to ch1-ch4

Closes #27

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a test verifying that a partial --dataset-map with only 2 channels
(FXI use case from issue #27) produces an HDF5 file with exactly those
2 datasets and no others.

New fixtures:
- zebra_caproto_ioc_fxi_map: IOC started with
  --dataset-map='{"ch1": "enc1_pi_r", "ch2": "zebra_time"}'
- zebra_ophyd_device_fxi_map: ophyd device pointing at ZEBRA_FXI prefix

New test:
- test_zebra_fxi_partial_dataset_map: stages, acquires, and checks that
  the resulting HDF5 contains exactly {"enc1_pi_r", "zebra_time"} —
  no more, no less.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a test that runs three ZebraSaveIOC instances simultaneously and
verifies each produces an HDF5 file with exactly the expected datasets:

  - SRX Zebra (default map):   enc1, enc2, enc3, zebra_time
  - SRX SIS   (scaler map):    i0, im, it, sis_time
  - FXI       (partial 2-ch):  enc1_pi_r, zebra_time

Each IOC is started with a distinct PV prefix so they run independently
in the same session. Stage, acquire, and unstage calls are initiated for
all three before waiting, exercising concurrent operation.

New session fixtures:
  - zebra_caproto_ioc_conc_srx_zebra  (ZEBRA_CONC_SRXZ prefix)
  - zebra_caproto_ioc_conc_srx_sis    (ZEBRA_CONC_SRXS prefix, explicit
                                       scaler dataset-map)

New function fixtures:
  - zebra_ophyd_device_conc_srx_zebra
  - zebra_ophyd_device_conc_srx_sis

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant