Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to template chunk specs? #59

Open
willirath opened this issue Dec 17, 2019 · 2 comments
Open

How to template chunk specs? #59

willirath opened this issue Dec 17, 2019 · 2 comments

Comments

@willirath
Copy link

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)?

@martindurant
Copy link
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.

@willirath
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants