Skip to content

Flexible dimension ordering#166

Merged
aliddell merged 18 commits intoacquire-project:mainfrom
aliddell:flexible-dimension-order
Apr 1, 2024
Merged

Flexible dimension ordering#166
aliddell merged 18 commits intoacquire-project:mainfrom
aliddell:flexible-dimension-order

Conversation

@aliddell
Copy link
Member

@aliddell aliddell marked this pull request as ready for review March 29, 2024 17:00
@aliddell aliddell requested a review from nclack March 29, 2024 17:00
Copy link
Member

@nclack nclack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow the __init__.pyi change from #173 didn't make it in here.

Left some other comments too.

Comment on lines 40 to 44
dimension_x = acquire.StorageDimension()
dimension_x.name = "x"
dimension_x.kind = acquire.DimensionType.Space
dimension_x.array_size_px = 64
dimension_x.chunk_size_px = 64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this construction work?

Suggested change
dimension_x = acquire.StorageDimension()
dimension_x.name = "x"
dimension_x.kind = acquire.DimensionType.Space
dimension_x.array_size_px = 64
dimension_x.chunk_size_px = 64
dimension_x = acquire.StorageDimension(name="x",
kind=acquire.DimensionType.Space,
array_size_px=64,
chunk_size_px=64)

Also, we might support string translation for enums,

Suggested change
dimension_x = acquire.StorageDimension()
dimension_x.name = "x"
dimension_x.kind = acquire.DimensionType.Space
dimension_x.array_size_px = 64
dimension_x.chunk_size_px = 64
dimension_x = acquire.StorageDimension(name="x",
kind="Space",
array_size_px=64,
chunk_size_px=64)

I'm not sure which is best, but I like using the constructor here.

Copy link
Member Author

@aliddell aliddell Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The former construction doesn't work (but I think I could figure out how to make it work). I don't like string translation for the enums. The values are already there and AFAIK we don't do it for the other enums. I was wrong about that last part lol

The former construction doesn't work -- it wants a string, but it works with a string. I didn't realize we had the kwargs constructor here.

Comment on lines 73 to 77
class DimensionType:
Space: ClassVar[DimensionType]
Channel: ClassVar[DimensionType]
Time: ClassVar[DimensionType]
Other: ClassVar[DimensionType]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have documentation that might guide users on which one to pick?

In my head, these affect ome-zarr metadata and (in the future maybe) impact what we do with on-the-fly lod's. e.g. We might downsample in space and time but not channel.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All we have is this in the acquire-driver-zarr readme:

The first two dimensions should represent the width and height of the frame, respectively. The array_size_px for these dimensions should match the width and height of the frame, and the kind field should be DimensionType_Space. The rest of the dimensions should match the order of acquisition.

We might downsample in space and time but not channel.

Yeah exactly. I can add docstrings in acquire.pyi

@aliddell aliddell requested a review from nclack March 29, 2024 22:55
Copy link
Member

@nclack nclack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aliddell aliddell merged commit c245899 into acquire-project:main Apr 1, 2024
@aliddell aliddell deleted the flexible-dimension-order branch April 1, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants