Skip to content

Commit 05e4935

Browse files
dccoteclaude
andcommitted
Nest the acquisition notification inside AnalogInputStreamCapability
Problem: DAQNotification (willAcquire/didAcquire) sat as a free-floating module-level enum in capabilities.py, unattached to the capability that posts it. Solution: Nest it as AnalogInputStreamCapability.Notification, inside the acquisition capability it belongs to, so the notification is discoverable from the capability that raises it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 8f108d4 commit 05e4935

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ API changes can land even when the minor version is unchanged.
5252
`hardwarelibrary/capabilities.py`, and share one `Capability` base class (the
5353
per-family `sources/capabilities.py`, `powermeters/capabilities.py`, and
5454
`daq/daqdevice.py` are removed; the DAQ enums `InputSource`, `TriggerSource`,
55-
`SampleClock`, `DAQNotification` move there too). Imports must point at
55+
`SampleClock` move there too, and the acquisition notification enum is now
56+
nested as `AnalogInputStreamCapability.Notification`). Imports must point at
5657
`hardwarelibrary.capabilities` (the family package `__init__`s still re-export
5758
their own mixins, so `from hardwarelibrary.daq import AnalogIOCapability` and
5859
the like keep working). `capabilities()` / `hasCapability()` are hoisted onto

hardwarelibrary/capabilities.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -288,11 +288,6 @@ def doGetAvailableScales(self) -> list:
288288
# DAQ capabilities
289289
# ---------------------------------------------------------------------------
290290

291-
class DAQNotification(Enum):
292-
willAcquire = "willAcquire"
293-
didAcquire = "didAcquire"
294-
295-
296291
class AnalogInputCapability(Capability):
297292
"""Analog input capability (ADC). Combine with PhysicalDevice in a driver."""
298293

@@ -351,6 +346,10 @@ class AnalogInputStreamCapability(AnalogInputCapability):
351346
device.stopStream()
352347
"""
353348

349+
class Notification(Enum):
350+
willAcquire = "willAcquire"
351+
didAcquire = "didAcquire"
352+
354353
@abstractmethod
355354
def configureStream(self, channels, sampleRate):
356355
"""Set up a hardware-timed acquisition of channels at sampleRate (Hz)."""

0 commit comments

Comments
 (0)