Skip to content

Conversation

@aleql
Copy link
Contributor

@aleql aleql commented Sep 4, 2025

This draft introduces the first working version of Zarr metadata streaming integration into MDV, enabling the backend to fetch and the frontend to display metadata from both standard Zarr stores and SpatialData datasets hosted at HTTP/HTTPS URLs.

Key Features

  • Dependencies: Added zarr<3.0, fsspec^2025.7.0, and requests^2.32.5
  • Backend (zarr_utils.py):
    • Implemented ZarrMetadataExtractor with:
      • Automatic format detection (Zarr vs SpatialData)
      • Specialized processors for images, points, shapes, and AnnData-like tables
      • Dataset-level format flag (datasetFormat) in responses
  • API: Added new Flask endpoint at /project/<id>/get_metadata
  • Frontend (ZarrMetadataDialog.tsx):
    • Updated to request metadata from backend given an input URL
    • Added format-aware UI:
      • SpatialData → Displays Images, Points, Shapes, AnnData Tables
      • Standard Zarr → Displays groups/arrays view with format indicator
    • Improved error handling and placeholders for dataset URLs

Next Steps

  • Extract metadata integration logic (modules, endpoints, etc.) into a dedicated submodule under mdvtools to reduce complexity in server.py and project scripts

  • Proceed with hydration architecture as outlined in the proposal document (https://cmdoxford.atlassian.net/wiki/x/AYAgvg)

xinaesthete and others added 18 commits August 4, 2025 12:13
Introduces a new ZarrMetadataDialog for exploring locally hosted Xenium Zarr dataset metadata, including dialog components, utility functions for metadata extraction, and integration into the menu bar with a new 'Add Remote Datasource' button. This enables users to fetch and inspect remote Zarr datasets directly from the UI.
- zarr<3.0: core array and metadata parsing
- fsspec^2025.7.0: flexible filesystem + HTTP access
- requests^2.32.5: robust HTTP client for dataset fetching
The dialog now fetches metadata directly from the backend API,
removing mock responses. Includes updated placeholders for local
datasets and streamlined error messages for MVP testing.
Adds ZarrMetadataExtractor and supporting utilities to parse
and normalize Zarr dataset structure.
- Exposes new GET /zarr/metadata?url=... route
- Integrates with ZarrMetadataExtractor to fetch and normalize dataset metadata
- Returns structured JSON with dataset groups, arrays, and attributes
- Provides error handling for invalid URLs, missing files, or format issues
- added automatic dataset format detection in ZarrMetadataExtractor (zarr_utils.py)
- implemented specialized processors for SpatialData (images, points, shapes, AnnData tables)
- responses now include a datasetFormat field (spatialdata or zarr)
- enhanced dialog to display SpatialData-specific details (image scales, table components, etc.)
- created python/mdvtools/metadata/ package
- extracted /get_metadata endpoint logic (lines 160–246 from server.py) into metadata/routes.py
- updated server.py to import and register routes via register_metadata_routes(project_bp, project)
- removed original endpoint code from server.py
- cleaned up unused imports (now scoped to the metadata module)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 4, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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