pangeo-data / zarr-proxy

A proxy for Zarr stores that allows for chunking overrides.
Apache License 2.0
9 stars 3 forks source link

Use a more complex chunks header #7

Closed andersy005 closed 1 year ago

andersy005 commented 1 year ago

This PR is an attempt at implementing a more complex chunks header as suggested by @rabernat in https://github.com/pangeo-data/zarr-proxy/issues/6#issuecomment-1404140009.

with this PR, we should be to define headers as follows:

'chunks: lat=10,air=10,10'

on FastAPI side, this is parsed into a a dictionary

In [1]: from zarr_proxy.logic import parse_chunks_header

In [2]: parse_chunks_header('lat=10,air=10,10')
Out[2]: {'lat': (10,), 'air': (10, 10)}

Cc @katamartin

andersy005 commented 1 year ago

@rabernat, do you have any thoughts/feedback on this? :)

rabernat commented 1 year ago

My main feedback is that your should write down somewhere (maybe just the main README?) what exactly the specification is for the header, and what will happen for missing and or non-conforming headers.

I would also write down how clients are supposed to figure this out.

My concern is that the implementation here is very tightly coupled to your front-end development needs. That's fine, but just make sure you document the interface clearly.

andersy005 commented 1 year ago

thank you, @rabernat!

I would also write down how clients are supposed to figure this out.

i plan to add docs in the coming days and will certainly make sure this is covered.

My concern is that the implementation here is very tightly coupled to your front-end development needs. That's fine, but just make sure you document the interface clearly.

👍🏽