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

Capabilities interface #113

Merged
merged 29 commits into from
Nov 28, 2023

Conversation

aliddell
Copy link
Member

@aliddell aliddell commented Nov 17, 2023

  • Expose and test Capabilities interface in Python.
  • Remove a bunch of commented code in camera.rs.

Note: Storage metadata is unqueryable unless you start the runtime (issue here). In the test test_storage_capabilities, it was necessary to start the runtime for the test to pass, but that's really pretty terrible and I wouldn't choose to do that.

@aliddell
Copy link
Member Author

See checks for 79f117c marked "pull_request", rather than "pull_request_target".

Copy link
Contributor

@andy-sweet andy-sweet left a comment

Choose a reason for hiding this comment

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

Zarr V3 stuff looks good other than some nits/optional suggestions.

Still need to take a closer look at the capabilities stuff. From a quick look at the implementation and tests, I think it looks fine, though maybe the implementation is more verbose than I was expecting.

Optional, but I do think this would be easier to review if it was split into 2 (or maybe 3) PRs. One for Zarr V3 support + tests, one for capabilities, and maybe an extra one for some of the other stuff (version, readme updates, clean up).

tests/test_basic.py Outdated Show resolved Hide resolved
tests/test_basic.py Outdated Show resolved Hide resolved
tests/test_basic.py Outdated Show resolved Hide resolved
tests/test_basic.py Outdated Show resolved Hide resolved
@aliddell
Copy link
Member Author

Optional, but I do think this would be easier to review if it was split into 2 (or maybe 3) PRs. One for Zarr V3 support + tests, one for capabilities, and maybe an extra one for some of the other stuff (version, readme updates, clean up).

FWIW, I opened it when I thought it would be smaller and get in faster. Happy to split.

@aliddell aliddell marked this pull request as draft November 22, 2023 15:50
@aliddell aliddell changed the title Zarr v3 plus Capabilities interface Capabilities interface Nov 22, 2023
@aliddell aliddell marked this pull request as ready for review November 22, 2023 22:49
@aliddell aliddell requested a review from andy-sweet November 22, 2023 22:50
Copy link
Contributor

@andy-sweet andy-sweet left a comment

Choose a reason for hiding this comment

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

After a first pass, this mostly looks fine. I focused on the Python class definitions, rather than the binding implementations. The only one that looked like slightly strange/unexpected is TriggerCapabilities (see the line comment for more details).

src/camera.rs Outdated Show resolved Hide resolved
src/capabilities.rs Outdated Show resolved Hide resolved
src/camera.rs Outdated
#[pyclass]
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CameraCapabilities {
#[pyo3(get, set)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should most (maybe all?) of the Python attributes/properties in this PR be read-only (i.e. pyo3(get))?

Or do we need the set internally?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't actually need set internally. Will fix.

@aliddell aliddell force-pushed the zarrv3-plus-capabilities branch from b32fde5 to 1c102ee Compare November 27, 2023 18:39
@aliddell aliddell requested a review from andy-sweet November 27, 2023 18:39
Copy link
Contributor

@andy-sweet andy-sweet left a comment

Choose a reason for hiding this comment

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

Looks good to me now. I have a nit to pick around the ChunkingShardingCapabilities class name, but I'll leave that up to you.

Given the amount of new public API here, I think it could be worth @nclack taking a pass over this too.

height: int
planes: int
class StorageCapabilities:
chunk_dims_px: ChunkingShardingCapabilities
Copy link
Contributor

@andy-sweet andy-sweet Nov 27, 2023

Choose a reason for hiding this comment

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

Nit: I don't love the name of the type here because it's long and includes two needs (that are the same right now, but might diverge in the future?). Is it worth using the same underlying private definition, but defining separately named classes for ChunkingCapabilities and ShardingCapabilities?

Similar comment for ChunkingShardingDims.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. I like the idea of exposing ChunkingCapabilities and ShardingCapabilities even though they derive from the same private type.

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.

ChunkingShardingCapabilities should be changed but otherwise looks good. I'm having a little trouble running tests locally but it's probably something I'm doing wrong.

@@ -4,6 +4,7 @@ imgui.ini
Testing
*.zarr
*.tif
*.bin
Copy link
Member

Choose a reason for hiding this comment

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

where's the bin coming from?

Copy link
Member Author

Choose a reason for hiding this comment

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

Writing out a raw file in one of the tests.

height: int
planes: int
class StorageCapabilities:
chunk_dims_px: ChunkingShardingCapabilities
Copy link
Member

Choose a reason for hiding this comment

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

Agreed. I like the idea of exposing ChunkingCapabilities and ShardingCapabilities even though they derive from the same private type.

…dingCapabilities. Split ChunkingShardingDims into ChunkDims and ShardDims.
@aliddell aliddell merged commit d71f3d0 into acquire-project:main Nov 28, 2023
20 checks passed
@aliddell aliddell deleted the zarrv3-plus-capabilities branch November 28, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants