-
Notifications
You must be signed in to change notification settings - Fork 25
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
Include chunk shape as a parameter in stream resource for HDF dataset #544
Merged
Merged
Changes from 21 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
2202413
Adding record for num frames in chunk along with chunk_size field in …
jwlodek 02332c3
Attributes are saved all in a single chunk
jwlodek 561da46
Update tests to account for chunk_size datakey parameter
jwlodek edc8f1c
Chunk size should be in sres not desc
jwlodek 3cfb4e7
Move chunk size to sres parameters
jwlodek 8117e4b
Refactor tests to reflect changes
jwlodek 3313d1a
Merge branch 'main' of https://github.com/bluesky/ophyd-async into ch…
jwlodek ada0b15
chunk size can be int or none
jwlodek a835183
Update chunk size signal to non-zero in one of the AD test sets
jwlodek 31dfcb1
Merge branch 'main' of https://github.com/bluesky/ophyd-async into ch…
jwlodek 54e42f0
Use correct chunk size for PandA, make sure we use chunk size auto
jwlodek ad8b63f
Add comment on chunk size
jwlodek 9856e2e
Make chunk_size a tuple that explicitly describes all chunk dims
jwlodek 386e61b
Make sure chunk size is tuple even with one dim, update tests, simpli…
jwlodek 415c398
Make chunk_size always tuple of int, default to empty tuple
jwlodek deec8d1
Merge branch 'main' into chunk-size-in-sres
jwlodek 5ad4b7a
Use readback value to avoid disconnect between actual value and signa…
jwlodek 09b51b3
Merge branch 'chunk-size-in-sres' of https://github.com/jwlodek/ophyd…
jwlodek 578969c
Follow import convention for tests
jwlodek 00275f3
Make use of slicing for detector name in ad_standard_det_factory clearer
jwlodek 025ac06
Merge branch 'main' into chunk-size-in-sres
jwlodek 1600a2c
Rename chunk size to chunk shape
jwlodek 4a76859
Merge branch 'main' into chunk-size-in-sres
jwlodek f105e34
Add space for linting
jwlodek 395b58b
Merge branch 'chunk-size-in-sres' of https://github.com/jwlodek/ophyd…
jwlodek 3821fc6
Merge branch 'main' of https://github.com/bluesky/ophyd-async into ch…
jwlodek 398ac01
Fix test
jwlodek 9e28151
Merge with upstream
jwlodek 0bd5ba2
Fix merge conflict
jwlodek 4d01dae
Simplifying ad standard det factory fixture
jwlodek 4f15ac1
Fix unawaited task issue
jwlodek 4d4e12e
kinetix fixture doesn't need to be async
jwlodek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,11 @@ async def _update_datasets(self) -> None: | |
|
||
capture_table = await self.panda_data_block.datasets.get_value() | ||
self._datasets = [ | ||
HDFDataset(dataset_name, "/" + dataset_name, [1], multiplier=1) | ||
# TODO: Update chunk size to read signal once available in IOC | ||
# Currently PandA IOC sets chunk size to 1024 points per chunk | ||
Comment on lines
+108
to
+109
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please make it an issue and link here. |
||
HDFDataset( | ||
dataset_name, "/" + dataset_name, [1], multiplier=1, chunk_size=(1024,) | ||
) | ||
for dataset_name in capture_table["name"] | ||
] | ||
|
||
|
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,34 @@ | ||
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 | ||
async def ad_standard_det_factory( | ||
RE: RunEngine, | ||
static_path_provider, | ||
) -> StandardDetector: | ||
async def generate_ad_standard_det(ad_standard_detector_class, number=1): | ||
# 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")] | ||
|
||
async 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 |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the second half of this is actually always true, we happen to make this so for areaDetector, but in the general case the chunk size is just that, the size of the HDF chunk. This may or may not correspond to a multiple of images, it might be half an image in one direction and 15 in the other, but its magnitude is in the base datatype of the dataset.
I wonder if
chunk_shape
might be a better name to make people think ofshape
in the output ofdescribe()
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually had the same thought yesterday about calling it
chunk_shape
. If it's not too late, I'd +1 to that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No preference from me about
chunk_shape
overchunk_size
- perhaps lets discuss tomorrow at the sprint catchup, and we can settle on a naming scheme