Skip to content

Add optional FixedScaleOffset dimension preservation - #853

Open
shixi-li wants to merge 1 commit into
zarr-developers:mainfrom
shixi-li:codex/keep-fixedscaleoffset-dimensions
Open

Add optional FixedScaleOffset dimension preservation#853
shixi-li wants to merge 1 commit into
zarr-developers:mainfrom
shixi-li:codex/keep-fixedscaleoffset-dimensions

Conversation

@shixi-li

Copy link
Copy Markdown

Closes #852.

Summary

  • add an opt-in keep_dimensions parameter to FixedScaleOffset, with the existing flattened output retained by default
  • preserve multidimensional shapes in both encode and decode, including logical coordinates when out uses the opposite C/F memory order
  • include the option in codec config and repr, document it in the class docstring and release notes, and retain compatibility with legacy configs

Validation

  • uv run pytest -q tests/test_fixedscaleoffset.py — 15 passed
  • uv run pytest -q — 654 passed, 32 optional-dependency skips
  • uv run ruff check src/numcodecs/fixedscaleoffset.py tests/test_fixedscaleoffset.py
  • uv run ruff format --check src/numcodecs/fixedscaleoffset.py tests/test_fixedscaleoffset.py
  • uv run mypy src/numcodecs/fixedscaleoffset.py tests/test_fixedscaleoffset.py
  • git diff --check
  • documentation build reached the updated API and release pages, but -W remains blocked by the current environment existing optional-codec imports and unrelated cross-reference warnings

Checklist

  • Unit tests and/or doctests in docstrings
  • Tests pass locally
  • Docstrings and API docs for the modified user-facing class
  • Changes documented in docs/release.md
  • Docs build locally without existing warnings
  • GitHub Actions CI passes
  • Test coverage to 100% (Codecov passes)

AI assistance

Codex assisted with test planning and independent review. I ran the tests and quality checks, inspected the final diff, and addressed a cross-memory-order out regression found during review.

@shixi-li
shixi-li marked this pull request as ready for review August 11, 2026 14:12
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.

FixedScaleOffset flattens arrays, breaking further image codecs

1 participant