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

Anchor-independent xrfreq search #272

Open
1 task done
aulemahal opened this issue Oct 12, 2023 · 0 comments
Open
1 task done

Anchor-independent xrfreq search #272

aulemahal opened this issue Oct 12, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@aulemahal
Copy link
Collaborator

aulemahal commented Oct 12, 2023

Addressing a Problem?

Searching in a catalog for xrfreq='YS' will not match the entries where that frequency is written as AS-JAN. Same thing for QS vs QS-APR vs QS-JUL vs QS-OCT (and the other 2 groups).

Potential Solution

I see three solutions:

  1. In search, expand the requested list with all equivalent xrfreq.
  2. Normalize all frequencies that come in the catalog.

Number 2 is my favorite, but the issue is that we don't control all the ways to add entries to the catalog. I guess the normalization could be run upon loading the catalog, as well as in update.

Additional context

xr.infer_freq always returns : AS-JAN, QS-OCT, QS-NOV or QS-DEC. compute_indicators will usually use infer_freq to find the frequency to use in the catalog. Thus, if one passes freq='YS', there's an inconsistency between the output catalog and the input yaml. Only fixing the annual case is easy, but it becomes inelegant when we want to fix the seasonal cases too.

Contribution

  • I would be willing/able to open a Pull Request to contribute this feature.
@aulemahal aulemahal added the enhancement New feature or request label Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant