fsspec / fsspec/kerchunk

Compression and filters as properties of chunk instead of variable

Open
#254 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
366
Forks
96
Avg merge
24m
Merged PRs (30d)
1

Description

It is possible that different netCDF/HDF5 files have different variable configuration. For example, for https://s3.amazonaws.com/era5-pds/2021/05/data/air_pressure_at_mean_sea_level.nc, time0 is contiguous but for https://s3.amazonaws.com/era5-pds/2021/01/data/air_pressure_at_mean_sea_level.nc it is chunked.

Although it is easy to simulate chunks from a contiguous variable, when setting the time0/.zattrs properties, filters and compression will affect variables with different configurations and produce an error.

Would it be possible to implement compression and filters as properties of chunks instead of variables? It would be something like:

{
  ".zgroup": "{\n    \"zarr_format\": 2\n}",
  ".zattrs": "{\n    \"Conventions\": \"UGRID-0.9.0\n\"}",
  "x/.zattrs": "{\n    \"_ARRAY_DIMENSIONS\": [\n        \"node\"\n ...",
  "x/.zarray": "{\n    \"chunks\": [\n        9228245\n    ],\n   \"dtype\": \"<f8\",\n  ...",
  "x/0": {
    "store": "s3://bucket/path/file.nc",
    "location": 294094376,
    "size": 73825960,
    "compressor": {...},
    "filters": [...]
  }
}

Example files:

https://s3.amazonaws.com/era5-pds/2021/06/data/air_pressure_at_mean_sea_level.nc
https://s3.amazonaws.com/era5-pds/2021/07/data/air_pressure_at_mean_sea_level.nc

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

No repository files, tests, or entry points are named. Start by tracing how variable .zattrs/.zarray metadata and chunk locations are generated, then verify that files with differing chunk compression and filters can be represented without configuration errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cloud, data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.