-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include chunk shape as a parameter in stream resource for HDF dataset (…
…#544) * Adding record for num frames in chunk along with chunk_size field in desc * Attributes are saved all in a single chunk * Update tests to account for chunk_size datakey parameter * Chunk size should be in sres not desc * Move chunk size to sres parameters * Refactor tests to reflect changes * chunk size can be int or none Co-authored-by: Eugene <[email protected]> * Update chunk size signal to non-zero in one of the AD test sets * Use correct chunk size for PandA, make sure we use chunk size auto * Add comment on chunk size * Make chunk_size a tuple that explicitly describes all chunk dims * Make sure chunk size is tuple even with one dim, update tests, simplify ad standard det tests * Make chunk_size always tuple of int, default to empty tuple * Use readback value to avoid disconnect between actual value and signal get * Follow import convention for tests * Make use of slicing for detector name in ad_standard_det_factory clearer * Rename chunk size to chunk shape * Add space for linting * Fix test * Fix merge conflict * Simplifying ad standard det factory fixture * Fix unawaited task issue * kinetix fixture doesn't need to be async --------- Co-authored-by: Eugene <[email protected]>
- Loading branch information
Showing
11 changed files
with
112 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
from collections.abc import Callable | ||
|
||
import pytest | ||
from bluesky.run_engine import RunEngine | ||
|
||
from ophyd_async.core._detector import StandardDetector | ||
from ophyd_async.core._device import DeviceCollector | ||
from ophyd_async.core._mock_signal_utils import set_mock_value | ||
|
||
|
||
@pytest.fixture | ||
def ad_standard_det_factory( | ||
RE: RunEngine, | ||
static_path_provider, | ||
) -> Callable: | ||
def generate_ad_standard_det( | ||
ad_standard_detector_class, number=1 | ||
) -> StandardDetector: | ||
# Dynamically generate a name based on the class of detector | ||
detector_name = ad_standard_detector_class.__name__ | ||
if detector_name.endswith("Detector"): | ||
detector_name = detector_name[: -len("Detector")] | ||
|
||
with DeviceCollector(mock=True): | ||
test_adstandard_det = ad_standard_detector_class( | ||
f"{detector_name.upper()}{number}:", | ||
static_path_provider, | ||
name=f"test_ad{detector_name.lower()}{number}", | ||
) | ||
|
||
# Set number of frames per chunk and frame dimensions to something reasonable | ||
set_mock_value(test_adstandard_det.hdf.num_frames_chunks, 1) | ||
set_mock_value(test_adstandard_det.drv.array_size_x, 10) | ||
set_mock_value(test_adstandard_det.drv.array_size_y, 10) | ||
|
||
return test_adstandard_det | ||
|
||
return generate_ad_standard_det |
Oops, something went wrong.