Skip to content

Conversation

@Arshya-Guru
Copy link

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.

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.
Copy link

Copilot AI left a 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="/") with out_zarr in two conversion scripts
  • Added explicit group.attrs["omero"] = omero assignment in tif_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.py now includes group.attrs[\"omero\"] = omero after calling write_image(), but this script does not. This inconsistency suggests either both scripts should explicitly set the omero attributes, or neither should if write_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
Copy link

Copilot AI Jan 16, 2026

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().

Suggested change
store = out_zarr
store = zarr.DirectoryStore(out_zarr, dimension_separator="/")

Copilot uses AI. Check for mistakes.
store = zarr.ZipStore(out_zarr, dimension_separator="/", mode="x")
else:
store = zarr.DirectoryStore(out_zarr, dimension_separator="/")
store = out_zarr
Copy link

Copilot AI Jan 16, 2026

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().

Suggested change
store = out_zarr
store = zarr.DirectoryStore(out_zarr, dimension_separator="/")

Copilot uses AI. Check for mistakes.
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.

1 participant