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

Fix lazy indexing #1484

Merged
merged 5 commits into from
Oct 11, 2023
Merged

Fix lazy indexing #1484

merged 5 commits into from
Oct 11, 2023

Conversation

aulemahal
Copy link
Collaborator

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGES.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?

  • lazy_indexing will drop any auxiliary coords it find on the intermediate array that was triggering computation. The output is not affected.
  • New xclim.testing.helpers.assert_lazy. A context manager to ensure the code block is not triggering any computation. I might take time to add it to other tests in another PR.
  • Took the opportunity to fix a deprecation warning coming out of importlib.resources. The way we opened and searched for module data files was deprecated. Oups, I realized this deprecation concerns python >= 3.9, but we still support python 3.8. This change doesn't justify pinning a new python.

Does this PR introduce a breaking change?

No.

Other information:

@github-actions
Copy link

Warning
This Pull Request is coming from a fork and must be manually tagged approved in order to perform additional testing.

Copy link
Collaborator

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat!

@github-actions github-actions bot added the approved Approved for additional tests label Oct 10, 2023
@aulemahal aulemahal merged commit e53c125 into master Oct 11, 2023
23 checks passed
@aulemahal aulemahal deleted the fix-lazy-indexing branch October 11, 2023 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for additional tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lazy indexing not lazy
2 participants