Skip to content

How to template chunk specs? #59

Open

Description

@willirath

I have a use case where I'd like to catalog NEMO data and chunk depth dims which are called differently (deptht, depthu, ...).

The following explains (I hope), what I want to achieve:

[...]
sources:
  NEMO-Exp01:
    description: NEMO-Exp01
    driver: netcdf
    parameters:
      grid:
        description: grid
        allowed: ["t", "u", "v", "w"]
        default: "t"
        type: str
    args:
      urlpath: '/data/NEMO-Exp01/NEMO-Exp01_1m_20010101_20011231_grid_{{ grid.upper() }}.nc'
      chunks: {'depth{{ grid }}': 1, }
[...]

Is there a short way of doing this (without having 34 different entries that only differ in their grid)?

Activity

  1. martindurant commented on Dec 20, 2019

    @martindurant
    Member

    What does the second entry looks like?
    If you don't want to write out all of the entries, you could generate them or even write a Catalog class which can generate the entries at runtime.

  2. willirath commented on Dec 20, 2019

    @willirath
    Author

    What does the second entry looks like?

    Not sure I under stand. The full chunk spec would be something like:

    {
        'time': 1,
        'depth{{ grid }}': 1,
        'y': None,
        'x': 200
    }

    If you don't want to write out all of the entries, you could generate them or even write a Catalog class which can generate the entries at runtime.

    I guess generating them is the way to go then.

    Should I close here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions