-
Notifications
You must be signed in to change notification settings - Fork 2
Update instances of DirectoryStore #68
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
base: main
Are you sure you want to change the base?
Conversation
Change store initialization to use out_zarr directly for non-zip outputs.
Refactor store initialization for Zarr output.
Add 'omero' attribute to the group in the OME-Zarr conversion.
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.
Pull request overview
This PR simplifies zarr store creation by replacing explicit DirectoryStore instantiation with direct path strings for non-zip outputs, and adds explicit omero metadata assignment to the group attributes in one of the conversion scripts.
Changes:
- Replaced
zarr.DirectoryStore(out_zarr, dimension_separator="/")without_zarrin two conversion scripts - Added explicit
group.attrs["omero"] = omeroassignment intif_stacks_to_ome_zarr.py
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| workflow/scripts/tif_stacks_to_ome_zarr.py | Simplified store creation from DirectoryStore to string path; added explicit omero attributes assignment |
| workflow/scripts/imaris_to_ome_zarr.py | Simplified store creation from DirectoryStore to string path |
Comments suppressed due to low confidence (1)
workflow/scripts/imaris_to_ome_zarr.py:143
- The related script
tif_stacks_to_ome_zarr.pynow includesgroup.attrs[\"omero\"] = omeroafter callingwrite_image(), but this script does not. This inconsistency suggests either both scripts should explicitly set the omero attributes, or neither should ifwrite_image()already handles it through the metadata parameter. Review whether this explicit assignment is necessary for proper omero metadata handling and ensure consistency across both scripts.
write_image(
image=darr_channels,
group=group,
scaler=scaler,
coordinate_transformations=coordinate_transformations,
axes=axes,
metadata={"omero": omero},
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| store = zarr.ZipStore(out_zarr, dimension_separator="/", mode="x") | ||
| else: | ||
| store = zarr.DirectoryStore(out_zarr, dimension_separator="/") | ||
| store = out_zarr |
Copilot
AI
Jan 16, 2026
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.
Replacing zarr.DirectoryStore(out_zarr, dimension_separator=\"/\") with just out_zarr removes the explicit dimension_separator=\"/\" parameter. When zarr.group() receives a string path, it creates a DirectoryStore with the default dimension_separator ("."), not "/". This could break compatibility with existing zarr stores or downstream code that expects "/" as the separator. Consider using zarr.DirectoryStore(out_zarr, dimension_separator=\"/\") or explicitly passing the dimension_separator to zarr.group().
| store = out_zarr | |
| store = zarr.DirectoryStore(out_zarr, dimension_separator="/") |
| store = zarr.ZipStore(out_zarr, dimension_separator="/", mode="x") | ||
| else: | ||
| store = zarr.DirectoryStore(out_zarr, dimension_separator="/") | ||
| store = out_zarr |
Copilot
AI
Jan 16, 2026
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.
Replacing zarr.DirectoryStore(out_zarr, dimension_separator=\"/\") with just out_zarr removes the explicit dimension_separator=\"/\" parameter. When zarr.group() receives a string path, it creates a DirectoryStore with the default dimension_separator ("."), not "/". This could break compatibility with existing zarr stores or downstream code that expects "/" as the separator. Consider using zarr.DirectoryStore(out_zarr, dimension_separator=\"/\") or explicitly passing the dimension_separator to zarr.group().
| store = out_zarr | |
| store = zarr.DirectoryStore(out_zarr, dimension_separator="/") |
This PR updates instances of DirectoryStore to allow running spimprep on /nfs/khan/datasets/selma_abeta.
I’ve tested this for that use case; I’m not aware of any regressions, but would appreciate a review to confirm it doesn’t affect other workflows.