Skip to content

Add spatialdata-experimental-writer Python package - #76

Merged
xinaesthete merged 8 commits into
mainfrom
harvest/experimental-writer
Jul 2, 2026
Merged

Add spatialdata-experimental-writer Python package#76
xinaesthete merged 8 commits into
mainfrom
harvest/experimental-writer

Conversation

@xinaesthete

@xinaesthete xinaesthete commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Harvested from the larger points-loading branch as a self-contained slice. This package does not touch the TS render path and main never referenced it, so it applied as 8 clean cherry-picks off main.

New Python package python/spatialdata-experimental-writer (note that we will follow-up at some point by merging image codec writing into this, possibly with a different name, and publish to pypi):

  • Morton (2D) point index writer for SpatialData Points Parquet, following current Vitessce practice (morton_code_2d, {feature_key}_codes, controlled row groups, sentinel bbox rows). See ADR 0002.
  • CLI + a Textual TUI for driving writes and index options.
  • write-index-permutations benchmark tooling for comparing sort strategies (spatial Morton vs. feature-primary vs. compound) on a derivative Zarr store.
  • Tests for points sorting, zarr writes, and verification.

Notes:

  • Not run in isolation here (needs a uv env); it was green on the source branch.
  • Depends on / pairs with the ADRs in the companion docs PR.

🤖 Generated with Claude Code

- Added `pyproject.toml` for package configuration, including dependencies and build system.
- Created `README.md` with an overview of the experimental vector optimization writers for SpatialData.
- Implemented core functionality in `src/spatialdata_experimental_writer`, including Morton sorting and multiscale Parquet writing.
- Developed command-line interface in `cli.py` for various operations on SpatialData.
- Introduced Zarr integration for reading and writing points data.
- Added tests for key functionalities in `tests/test_points.py` and `tests/test_zarr.py`.
- Established package structure with necessary modules and scripts.
- Updated README.md to include detailed installation instructions and command usage for the experimental writer.
- Added a new script for benchmarking points index permutations, allowing users to evaluate performance based on index-manifest.json.
- Implemented a new CLI command for writing derivative Zarr stores with transcript index sort permutations.
- Introduced consolidated metadata registration for points elements in Zarr stores.
- Enhanced morton sorting functionality to support custom sort orders and ensure uint columns are not persisted in output Parquet files.
- Added integration tests to validate new features and ensure correct functionality across the package.
- Added a new Textual User Interface (TUI) for an interactive workflow, allowing users to execute commands in a guided manner.
- Updated `pyproject.toml` to include `textual` as a dependency for TUI functionality.
- Update the README with instructions for using the TUI, including command execution and verification checks.
- Refactored CLI commands to utilize new runner functions for improved organization and maintainability.
- Introduced verification checks for Morton and multiscale parquet outputs to ensure data integrity.
- Added unit tests for verification functions to validate their correctness and reliability.
Add InputFormScreen and refactor Existing Screens

- Introduced InputFormScreen as a base class for form handling, enabling consistent input navigation and submission across multiple screens.
- Refactored ZarrPathScreen, MortonFromZarrScreen, MortonFileScreen, MultiscaleScreen, and IndexPermutationsScreen to inherit from InputFormScreen, streamlining input management.
- Implemented action handling for back navigation and primary button submission in the new InputFormScreen.
- Enhanced user experience by ensuring focus transitions between input fields based on user input submission.
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@xinaesthete, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 53e33354-cd48-44fc-9a95-444816ae5dca

📥 Commits

Reviewing files that changed from the base of the PR and between f973983 and 91521b8.

⛔ Files ignored due to path filters (1)
  • python/spatialdata-experimental-writer/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • python/spatialdata-experimental-writer/README.md
  • python/spatialdata-experimental-writer/pyproject.toml
  • python/spatialdata-experimental-writer/scripts/benchmark_points_index.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/__init__.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/cli.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/errors.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/index_permutations.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/points.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/runners.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/tui/__init__.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/tui/app.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/tui/models.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/tui/screens.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/verify.py
  • python/spatialdata-experimental-writer/src/spatialdata_experimental_writer/zarr.py
  • python/spatialdata-experimental-writer/tests/test_integration.py
  • python/spatialdata-experimental-writer/tests/test_points.py
  • python/spatialdata-experimental-writer/tests/test_verify.py
  • python/spatialdata-experimental-writer/tests/test_zarr.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch harvest/experimental-writer

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.

@xinaesthete
xinaesthete merged commit f80f3a5 into main Jul 2, 2026
3 checks passed
@xinaesthete
xinaesthete deleted the harvest/experimental-writer branch July 2, 2026 06:21
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