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 bug in bulk_statistics when providing a DataArray or iris cube with dask array data #474

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

w-k-jones
Copy link
Member

Change .data to .values call in get_statistics_from_mask to prevent passing dask array to get_statistics, and added test for dask array input

Fixes #472

  • Have you followed our guidelines in CONTRIBUTING.md?
  • Have you self-reviewed your code and corrected any misspellings?
  • Have you written documentation that is easy to understand?
  • Have you written descriptive commit messages?
  • Have you added NumPy docstrings for newly added functions?
  • Have you formatted your code using black?
  • If you have introduced a new functionality, have you added adequate unit tests?
  • Have all tests passed in your local clone?
  • If you have introduced a new functionality, have you added an example notebook?
  • Have you kept your pull request small and limited so that it is easy to review?
  • Have the newest changes from this branch been merged?

…assing dask array to get_statistics, and added test for dask array input
@w-k-jones w-k-jones self-assigned this Dec 13, 2024
@w-k-jones w-k-jones added bug Code that is failing or producing the wrong result Small Change A minor change which should be quick to address and review labels Dec 13, 2024
Copy link

codecov bot commented Dec 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.67%. Comparing base (706b3ee) to head (0b75b46).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #474   +/-   ##
=======================================
  Coverage   60.67%   60.67%           
=======================================
  Files          23       23           
  Lines        3537     3537           
=======================================
  Hits         2146     2146           
  Misses       1391     1391           
Flag Coverage Δ
unittests 60.67% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@w-k-jones w-k-jones added this to the Version 1.5.5 milestone Dec 13, 2024
@w-k-jones
Copy link
Member Author

@freemansw1 @JuliaKukulies are you both happy to review this? Should be quick as it is a very tiny change (1 word) and an added test to check passing dask arrays to bulk statistics works

Copy link
Member

@JuliaKukulies JuliaKukulies left a comment

Choose a reason for hiding this comment

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

Good catch, thanks for fixing this @w-k-jones!

@JuliaKukulies
Copy link
Member

@w-k-jones, I assume that was the reason for the jupyter notebook fail in #417 ?

@w-k-jones
Copy link
Member Author

@w-k-jones, I assume that was the reason for the jupyter notebook fail in #417 ?

Yes, it looks like the same issue, so hopefully it will now be fixed

@freemansw1
Copy link
Member

Thanks for the quick fix, @w-k-jones

@w-k-jones w-k-jones merged commit feeff81 into tobac-project:main Dec 18, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Code that is failing or producing the wrong result Small Change A minor change which should be quick to address and review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with calculate_area
3 participants