Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve AD ERROR reports "capture not supported in Single mode" #858

Merged
merged 19 commits into from
May 20, 2023

Conversation

prjemian
Copy link
Contributor

@prjemian prjemian added the bug label May 17, 2023
@prjemian prjemian added this to the 1.6.16 milestone May 17, 2023
@prjemian prjemian self-assigned this May 17, 2023
@prjemian
Copy link
Contributor Author

Even though all tests pass locally, many of the tests in this test module generate such error messages:

(base) prjemian@zap:~/.../BCDA-APS/apstools$ camonitor -S ad:HDF1:{WriteMessage,EnableCallbacks}
ad:HDF1:WriteMessage           2023-05-17 18:05:05.387364 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:05:05.767026 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:05:54.945259 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:05:55.029437 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:05:55.068573 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:05:56.189505 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:05:56.643594 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:05:56.674391 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:05:56.714194 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:05:57.213803 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:05:57.644576 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:05:57.676220 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:05:57.715917 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:05:58.187591 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:05:58.796674 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:05:58.828834 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:05:58.868659 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:05:58.923066 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:06:01.490128 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:01.519515 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:06:01.558378 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:02.065016 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:06:02.525938 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:02.558696 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:06:02.599360 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:03.143576 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:06:03.681500 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:03.715093 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:06:03.755655 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:04.240177 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:06:04.697673 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:04.729627 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:06:04.767603 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:05.191405 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:06:05.864969 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:05.897785 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:06:05.938293 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:06.089613 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:06:06.606691 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:06.635076 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:06:06.674710 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:07.114726 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:06:07.280776 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:07.289131 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:06:07.329020 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:07.668980 Disable  
ad:HDF1:WriteMessage 2023-05-17 18:06:08.175512 ERROR: capture not supported in Single mode  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:08.194921 Enable  
ad:HDF1:WriteMessage           2023-05-17 18:06:08.233456 0  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:08.389444 Disable  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:08.733118 Enable  
ad:HDF1:EnableCallbacks        2023-05-17 18:06:08.777051 Disable  

@prjemian
Copy link
Contributor Author

Should address the source of this problem as part of this PR.

@prjemian
Copy link
Contributor Author

Encountering that same error message (ERROR: capture not supported in Single mode) when staging this structure using only ophyd code:

from ophyd import Component
from ophyd import DetectorBase
from ophyd import HDF5Plugin
from ophyd import SimDetectorCam
from ophyd import SingleTrigger
from ophyd.areadetector.filestore_mixins import FileStoreHDF5
from ophyd.areadetector.filestore_mixins import FileStoreIterativeWrite

from apstools.tests import READ_PATH_TEMPLATE
from apstools.tests import WRITE_PATH_TEMPLATE

class HDF5ResourcePlugin(HDF5Plugin, FileStoreHDF5, FileStoreIterativeWrite):
    """Include image file details in document stream."""

class AreaDetector(SingleTrigger, DetectorBase):
    cam = Component(SimDetectorCam, suffix="cam1:")
    hdf1 = Component(
        HDF5ResourcePlugin,
        suffix="HDF1:",
        write_path_template=WRITE_PATH_TEMPLATE,
        read_path_template=READ_PATH_TEMPLATE,
    )

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.hdf1.kind = 3  # Adds plugin to det.read_attrs

det = AreaDetector("ad:", name="det")
det.stage()

@prjemian
Copy link
Contributor Author

prjemian commented May 20, 2023

Ironically, this exact issue was repaired 2022-08-24, just weeks after the latest 1.7.0 release, 2022-08-05 in bluesky/ophyd#1066

A lot of work could have been avoided if that important fix had been bundled into a patch release 1.7.1!

@prjemian
Copy link
Contributor Author

Since b2141db, need to fix related tests, such as:

    def test_capture_error_with_single_mode(adsimdet):
        plugin = adsimdet.hdf1
    
        # test that plugin is in the wrong configuration for Single mode
        assert "capture" in plugin.stage_sigs
        assert list(plugin.stage_sigs)[-1] == "capture"
        assert "file_write_mode" in plugin.stage_sigs
        assert plugin.file_write_mode.enum_strs[0] == "Single"
        assert plugin.stage_sigs["file_write_mode"] == "Stream"
    
        # Test for this reported error message.
        err_message = "ERROR: capture not supported in Single mode"
    
        # A lot happens during device staging. The error message is posted and then
        # quickly cleared as the IOC responds to other items staged.  Collect this
        # transient message using a callback for later examination.
        mcache = MonitorCache(err_message)
    
        plugin.write_message.subscribe(mcache.receiver)
        plugin.stage()
        plugin.write_message.unsubscribe_all()
>       assert len(mcache.messages) >= 1
E       assert 0 >= 1
E        +  where 0 = len([])
E        +    where [] = <apstools.tests.MonitorCache object at 0x7f3479ad9600>.messages

@prjemian prjemian marked this pull request as ready for review May 20, 2023 13:59
@prjemian prjemian merged commit 09f57bd into main May 20, 2023
@prjemian prjemian deleted the 823-AD-HDF1-plugin-capture-not-in-Single-mode branch May 20, 2023 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AD.HDF1 plugin reports: ERROR: capture not supported in Single mode
1 participant