NCAS-CMS / NCAS-CMS/PyActiveStorage

Formalise compression and filters arguments in reduce_chunk, avoid numcodecs.Codec objects

Open
#125 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
6
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Currently we pass numcodecs.Codec objects as the compression and filters arguments to reduce_chunk. This is convenient for the local storage implementation, but does leave us reliant on the numcodecs library in what might be considered our internal "storage backend API".

It would be better to describe these algorithms using a Plain Old Data (POD) type, such as a dict.

See the original discussion.

As outlined in my proposal, I suggest we use arguments in the following format:

reduce_chunk(
    compression={"compression": {"id": "zlib"}},
    filters=[{"id": "shuffle", "dtype": "uint32"}]),
    ...
)

This aligns with the format used in the S3 active storage server API.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the reduce_chunk entry point and review the linked discussion, proposal, and S3 active storage server API for the intended argument shape. Confirm how compression and filters are currently represented and identify the compatibility expectations for storage backends. Done means reduce_chunk uses the proposed plain-data representation instead of numcodecs.Codec objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.