diff --git a/.travis.yml b/.travis.yml
index f6314f9..acc748e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -13,6 +13,8 @@ env:
 
 
 install:
+  # explicitly upgrade numpy to work around a problem with imagecodecs
+  - pip install --upgrade numpy
   # Install this package and the packages listed in requirements.txt.
   - pip install .
   # Install extra requirements for running tests and building docs.
diff --git a/bluesky_darkframes/__init__.py b/bluesky_darkframes/__init__.py
index 3806759..90f686d 100644
--- a/bluesky_darkframes/__init__.py
+++ b/bluesky_darkframes/__init__.py
@@ -97,7 +97,7 @@ class DarkFramePreprocessor:
     Parameters
     ----------
     dark_plan: callable
-        Expected siganture: ``dark_plan() -> snapshot_device``
+        Expected siganture: ``dark_plan(detector) -> snapshot_device``
     detector : Device
     max_age: float
         Time after which a fresh dark frame should be acquired
@@ -208,11 +208,11 @@ class DarkFramePreprocessor:
             try:
                 snapshot = self.get_snapshot(state)
             except NoMatchingSnapshot:
-                logger.info(f"Taking a new dark frame for state=%r", state)
-                snapshot = yield from self.dark_plan()
+                logger.info("Taking a new dark frame for state=%r", state)
+                snapshot = yield from self.dark_plan(self.detector)
                 self.add_snapshot(snapshot, state)
             if snapshot_changed or force_read:
-                logger.info(f"Creating a 'dark' Event for state=%r", state)
+                logger.info("Creating a 'dark' Event for state=%r", state)
                 self._current_snapshot.set_snaphsot(snapshot)
                 # Read the Snapshot into the 'dark' Event stream.
                 yield from bps.stage(self._current_snapshot)
diff --git a/docs/source/usage.rst b/docs/source/usage.rst
index 68f8dbe..22012a8 100644
--- a/docs/source/usage.rst
+++ b/docs/source/usage.rst
@@ -105,11 +105,11 @@ for whether/how dark frames can be reused.)
    det = DiffractionDetector(name='det')
    shutter = Shutter(name='shutter', value='open')
 
-   def dark_plan():
+   def dark_plan(detector):
        yield from bps.mv(shutter, 'closed')
-       yield from bps.trigger(det, group='darkframe-trigger')
+       yield from bps.trigger(detector, group='darkframe-trigger')
        yield from bps.wait('darkframe-trigger')
-       snapshot = bluesky_darkframes.SnapshotDevice(det)
+       snapshot = bluesky_darkframes.SnapshotDevice(detector)
        yield from bps.mv(shutter, 'open')
        return snapshot
 

Add detector argument to dark_plan()
Pass the detector from DarkFramePreprocessor to dark_plan().
diff --git a/bluesky_darkframes/tests/tests.py b/bluesky_darkframes/tests/tests.py
index eb56fbf..ff0f768 100644
--- a/bluesky_darkframes/tests/tests.py
+++ b/bluesky_darkframes/tests/tests.py
@@ -17,11 +17,11 @@ det.exposure_time.put(0.01)
 shutter = bluesky_darkframes.sim.Shutter(name='shutter', value='open')
 
 
-def dark_plan():
+def dark_plan(detector):
     yield from bps.mv(shutter, 'closed')
-    yield from bps.trigger(det, group='darkframe-trigger')
+    yield from bps.trigger(detector, group='darkframe-trigger')
     yield from bps.wait('darkframe-trigger')
-    snapshot = bluesky_darkframes.SnapshotDevice(det)
+    snapshot = bluesky_darkframes.SnapshotDevice(detector)
     yield from bps.mv(shutter, 'open')
     return snapshot
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest coverage flake8 codecov sphinx jupyter-sphinx matplotlib numpydoc sphinx-copybutton sphinx_rtd_theme bluesky >=1.6.0rc1 codecov coverage databroker flake8 ophyd scipy suitcase-tiff
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.16
appdirs==1.4.4
asciitree==0.3.3
asttokens==3.0.0
attrs==25.3.0
babel==2.17.0
beautifulsoup4==4.13.3
bleach==6.2.0
bluesky==1.13.1
-e git+https://github.com/bluesky/bluesky-darkframes.git@881efbd47aedf9856f4f7f45d90318ea4dc5b209#egg=bluesky_darkframes
bluesky-live==0.0.8
boltons==25.0.0
cachetools==5.5.2
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
cloudpickle==3.1.1
codecov==2.1.13
comm==0.2.2
contourpy==1.3.0
coverage==7.8.0
cycler==0.12.1
dask==2024.8.0
databroker==1.2.5
debugpy==1.8.13
decorator==5.2.1
defusedxml==0.7.1
Deprecated==1.2.18
dnspython==2.7.0
doct==1.1.0
docutils==0.21.2
entrypoints==0.4
event-model==1.22.3
exceptiongroup==1.2.2
executing==2.2.0
fasteners==0.19
fastjsonschema==2.21.1
flake8==7.2.0
flexcache==0.3
flexparser==0.4
fonttools==4.56.0
frozendict==2.4.6
fsspec==2025.3.1
historydict==1.2.6
humanize==4.12.2
idna==3.10
imageio==2.37.0
imagesize==1.4.1
importlib_metadata==8.6.1
importlib_resources==6.5.2
iniconfig==2.1.0
intake==0.6.4
ipykernel==6.29.5
ipython==8.18.1
ipywidgets==8.1.5
jedi==0.19.2
Jinja2==3.1.6
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter-sphinx==0.5.3
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyterlab_pygments==0.3.0
jupyterlab_widgets==3.0.13
kiwisolver==1.4.7
locket==1.0.0
MarkupSafe==3.0.2
matplotlib==3.9.4
matplotlib-inline==0.1.7
mccabe==0.7.0
mistune==3.1.3
mongoquery==1.4.2
msgpack==1.1.0
msgpack-numpy==0.4.8
nbclient==0.10.2
nbconvert==7.16.6
nbformat==5.10.4
nest-asyncio==1.6.0
networkx==3.2.1
numcodecs==0.12.1
numpy==2.0.2
numpydoc==1.8.0
opentelemetry-api==1.31.1
ophyd==1.10.0
packaging==24.2
pandas==2.2.3
pandocfilters==1.5.1
parso==0.8.4
partd==1.4.2
pexpect==4.9.0
pillow==11.1.0
PIMS==0.7
Pint==0.24.4
platformdirs==4.3.7
pluggy==1.5.0
prettytable==3.16.0
prompt_toolkit==3.0.50
psutil==7.0.0
ptyprocess==0.7.0
pure_eval==0.2.3
pycodestyle==2.13.0
pyflakes==3.3.2
Pygments==2.19.1
pymongo==4.11.3
pyparsing==3.2.3
pytest==8.3.5
python-dateutil==2.9.0.post0
pytz==2025.2
PyYAML==6.0.2
pyzmq==26.3.0
referencing==0.36.2
requests==2.32.3
rpds-py==0.24.0
scipy==1.13.1
six==1.17.0
slicerator==1.1.0
snowballstemmer==2.2.0
soupsieve==2.6
Sphinx==7.4.7
sphinx-copybutton==0.5.2
sphinx-rtd-theme==3.0.2
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
stack-data==0.6.3
suitcase-mongo==0.7.0
suitcase-msgpack==0.3.0
suitcase-tiff==0.4.0
suitcase-utils==0.5.4
tabulate==0.9.0
tifffile==2024.8.30
tinycss2==1.4.0
tomli==2.2.1
toolz==1.0.0
tornado==6.4.2
tqdm==4.67.1
traitlets==5.14.3
typing_extensions==4.13.0
tzdata==2025.2
tzlocal==5.3.1
urllib3==2.3.0
wcwidth==0.2.13
webencodings==0.5.1
widgetsnbextension==4.0.13
wrapt==1.17.2
xarray==2024.7.0
zarr==2.18.2
zipp==3.21.0

name: bluesky-darkframes
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.16
      - appdirs==1.4.4
      - asciitree==0.3.3
      - asttokens==3.0.0
      - attrs==25.3.0
      - babel==2.17.0
      - beautifulsoup4==4.13.3
      - bleach==6.2.0
      - bluesky==1.13.1
      - bluesky-live==0.0.8
      - boltons==25.0.0
      - cachetools==5.5.2
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - click==8.1.8
      - cloudpickle==3.1.1
      - codecov==2.1.13
      - comm==0.2.2
      - contourpy==1.3.0
      - coverage==7.8.0
      - cycler==0.12.1
      - dask==2024.8.0
      - databroker==1.2.5
      - debugpy==1.8.13
      - decorator==5.2.1
      - defusedxml==0.7.1
      - deprecated==1.2.18
      - dnspython==2.7.0
      - doct==1.1.0
      - docutils==0.21.2
      - entrypoints==0.4
      - event-model==1.22.3
      - exceptiongroup==1.2.2
      - executing==2.2.0
      - fasteners==0.19
      - fastjsonschema==2.21.1
      - flake8==7.2.0
      - flexcache==0.3
      - flexparser==0.4
      - fonttools==4.56.0
      - frozendict==2.4.6
      - fsspec==2025.3.1
      - historydict==1.2.6
      - humanize==4.12.2
      - idna==3.10
      - imageio==2.37.0
      - imagesize==1.4.1
      - importlib-metadata==8.6.1
      - importlib-resources==6.5.2
      - iniconfig==2.1.0
      - intake==0.6.4
      - ipykernel==6.29.5
      - ipython==8.18.1
      - ipywidgets==8.1.5
      - jedi==0.19.2
      - jinja2==3.1.6
      - jsonschema==4.23.0
      - jsonschema-specifications==2024.10.1
      - jupyter-client==8.6.3
      - jupyter-core==5.7.2
      - jupyter-sphinx==0.5.3
      - jupyterlab-pygments==0.3.0
      - jupyterlab-widgets==3.0.13
      - kiwisolver==1.4.7
      - locket==1.0.0
      - markupsafe==3.0.2
      - matplotlib==3.9.4
      - matplotlib-inline==0.1.7
      - mccabe==0.7.0
      - mistune==3.1.3
      - mongoquery==1.4.2
      - msgpack==1.1.0
      - msgpack-numpy==0.4.8
      - nbclient==0.10.2
      - nbconvert==7.16.6
      - nbformat==5.10.4
      - nest-asyncio==1.6.0
      - networkx==3.2.1
      - numcodecs==0.12.1
      - numpy==2.0.2
      - numpydoc==1.8.0
      - opentelemetry-api==1.31.1
      - ophyd==1.10.0
      - packaging==24.2
      - pandas==2.2.3
      - pandocfilters==1.5.1
      - parso==0.8.4
      - partd==1.4.2
      - pexpect==4.9.0
      - pillow==11.1.0
      - pims==0.7
      - pint==0.24.4
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - prettytable==3.16.0
      - prompt-toolkit==3.0.50
      - psutil==7.0.0
      - ptyprocess==0.7.0
      - pure-eval==0.2.3
      - pycodestyle==2.13.0
      - pyflakes==3.3.2
      - pygments==2.19.1
      - pymongo==4.11.3
      - pyparsing==3.2.3
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyyaml==6.0.2
      - pyzmq==26.3.0
      - referencing==0.36.2
      - requests==2.32.3
      - rpds-py==0.24.0
      - scipy==1.13.1
      - six==1.17.0
      - slicerator==1.1.0
      - snowballstemmer==2.2.0
      - soupsieve==2.6
      - sphinx==7.4.7
      - sphinx-copybutton==0.5.2
      - sphinx-rtd-theme==3.0.2
      - sphinxcontrib-applehelp==2.0.0
      - sphinxcontrib-devhelp==2.0.0
      - sphinxcontrib-htmlhelp==2.1.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==2.0.0
      - sphinxcontrib-serializinghtml==2.0.0
      - stack-data==0.6.3
      - suitcase-mongo==0.7.0
      - suitcase-msgpack==0.3.0
      - suitcase-tiff==0.4.0
      - suitcase-utils==0.5.4
      - tabulate==0.9.0
      - tifffile==2024.8.30
      - tinycss2==1.4.0
      - tomli==2.2.1
      - toolz==1.0.0
      - tornado==6.4.2
      - tqdm==4.67.1
      - traitlets==5.14.3
      - typing-extensions==4.13.0
      - tzdata==2025.2
      - tzlocal==5.3.1
      - urllib3==2.3.0
      - wcwidth==0.2.13
      - webencodings==0.5.1
      - widgetsnbextension==4.0.13
      - wrapt==1.17.2
      - xarray==2024.7.0
      - zarr==2.18.2
      - zipp==3.21.0
prefix: /opt/conda/envs/bluesky-darkframes

bluesky_darkframes/tests/tests.py::test_one_dark_event_emitted[False] bluesky_darkframes/tests/tests.py::test_one_dark_event_emitted[True] bluesky_darkframes/tests/tests.py::test_mid_scan_dark_frames[False] bluesky_darkframes/tests/tests.py::test_mid_scan_dark_frames[True] bluesky_darkframes/tests/tests.py::test_max_age[False] bluesky_darkframes/tests/tests.py::test_max_age[True] bluesky_darkframes/tests/tests.py::test_locked_signals[False] bluesky_darkframes/tests/tests.py::test_locked_signals[True] bluesky_darkframes/tests/tests.py::test_limit[False] bluesky_darkframes/tests/tests.py::test_limit[True]
bluesky_darkframes/tests/tests.py::test_streaming_export[False-None] bluesky_darkframes/tests/tests.py::test_streaming_export[False-0] bluesky_darkframes/tests/tests.py::test_streaming_export[False-100] bluesky_darkframes/tests/tests.py::test_streaming_export[True-None] bluesky_darkframes/tests/tests.py::test_streaming_export[True-0] bluesky_darkframes/tests/tests.py::test_streaming_export[True-100] bluesky_darkframes/tests/tests.py::test_no_dark_frames[False] bluesky_darkframes/tests/tests.py::test_no_dark_frames[True]
bluesky_darkframes/__init__.py .travis.yml docs/source/usage.rst
bluesky_darkframes/__init__.py .travis.yml docs/source/usage.rst