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

Exclude vars from catalogs in parse_directory #107

Merged
merged 1 commit into from Oct 18, 2022
Merged

Conversation

aulemahal
Copy link
Collaborator

Pull Request Checklist:

  • pre-commit hooks are installed/active in my local clone ($ pre-commit install)
  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes #xyz
  • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • If a merge request has been made in parallel to this PR in xscen-notebooks, it is merged and the submodules have been updated.
  • HISTORY.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

In the "variable" mapping passed to cvs in parse_directory, mapping a var name to None will exclude that var from the catalog. Meaning it won't appear in the variable column. The file entry is untouched. This is useful when one is reading the variables from the files (using read_from_file). It allows excluding things like time_bnds`.

Another technique would have been passing drop_variables to xr_open_kwargs, but this is not universal as the optimization will use netCDF4 or zarr to open the files when they can.

Does this PR introduce a breaking change?

No.

Other information:

@mccrayc

@aulemahal aulemahal merged commit 2276c85 into main Oct 18, 2022
@aulemahal aulemahal deleted the parsedir-dropvars branch October 18, 2022 15:22
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.

None yet

2 participants