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

Implement manifest preloading #649

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Implement manifest preloading #649

wants to merge 2 commits into from

Conversation

paraseba
Copy link
Collaborator

This creates a pretty advanced mechanism to configure what manifest should be preloaded on session creation.

It can match arrays by name, path or size; and it can create complex conditions using or and and combinators.

By default, we preload manifests that have not more than 1k refs, up to a total of 10k refs, and corresponding to arrays with names matching any of the following regexes:

  • \bt\b|(time|min|hour|day|week|month|year)[0-9]*
  • (z|nav_lev|gdep|lv_|[o]*lev|bottom_top|sigma|h(ei)?ght|altitude|depth|isobaric|pres|isotherm)[a-z_]*[0-9]*
  • y|j|nlat|rlat|nj
  • y?(nav_lat|lat|gphi)[a-z0-9]*
  • x?(nav_lon|lon|glam)[a-z0-9]*
  • x|i|nlon|rlon|ni

The regex were taken from:

https://github.com/xarray-contrib/cf-xarray/blob/1591ff5ea7664a6bdef24055ef75e242cd5bfc8b/cf_xarray/criteria.py#L149-L160

@paraseba
Copy link
Collaborator Author

Thank you @dcherian for showing me this list of regexes! Exactly what I needed

Base automatically changed from push-tpnlvxokrxol to main January 30, 2025 03:04
This creates a pretty advanced mechanism to configure what manifest
should be preloaded on session creation.

It can match arrays by name, path or size; and it can create complex
conditions using `or` and `and` combinators.

By default, we preload manifests that have not more than 1k refs,
up to a total of 10k refs, and corresponding to arrays with names
matching any of the following regexes:


* `\bt\b|(time|min|hour|day|week|month|year)[0-9]*`
* `(z|nav_lev|gdep|lv_|[o]*lev|bottom_top|sigma|h(ei)?ght|altitude|depth|isobaric|pres|isotherm)[a-z_]*[0-9]*`
* `y|j|nlat|rlat|nj`
* `y?(nav_lat|lat|gphi)[a-z0-9]*`
* `x?(nav_lon|lon|glam)[a-z0-9]*`
* `x|i|nlon|rlon|ni`


The regex were taken from:

https://github.com/xarray-contrib/cf-xarray/blob/1591ff5ea7664a6bdef24055ef75e242cd5bfc8b/cf_xarray/criteria.py#L149-L160
(and some other typing fixes)
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

Successfully merging this pull request may close these issues.

1 participant