bcdev / zappend

Robustly creating and updating Zarr data cubes from smaller subsets
https://bcdev.github.io/zappend/
MIT License
40 stars 1 forks source link

Define custom dataset attributes #60

Closed forman closed 8 months ago

forman commented 8 months ago

Is your feature request related to a problem? Please describe.

Users should be allowed to define custom dataset attributes. The values of attributes should be allowed to contain (Python) expressions evaluated in the context of the current target dataset. This way it is possible to dynamically update variables such as time_coverage_start and time_coverage_end. In the expression, the current dataset should be accessible by a variable named ds.

Ideally the solution would also work for variable attributes with current data array accessible by name v or var.

Describe the solution you'd like

Configuration example:

...
attrs:
    title: HROC Ocean Colour Monthly Composite
    time_coverage_start: {{ ds.time[0] }}
    time_coverage_end: {{ ds.time[-1] }}