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 xarray update #129

Merged
merged 6 commits into from
Sep 14, 2023
Merged

Fix xarray update #129

merged 6 commits into from
Sep 14, 2023

Conversation

brews
Copy link
Member

@brews brews commented Aug 11, 2023

Fix stuff so can run latest xarray v2023.8.0. Right now it depends on a version from about a year ago.

Close #103

@brews brews added the bug Something isn't working label Aug 11, 2023
@brews brews self-assigned this Aug 11, 2023
@brews brews added bug Something isn't working and removed bug Something isn't working labels Aug 11, 2023
@codecov
Copy link

codecov bot commented Aug 11, 2023

Codecov Report

Merging #129 (c3f41df) into main (f6e8e7f) will not change coverage.
Report is 11 commits behind head on main.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #129   +/-   ##
=======================================
  Coverage   65.30%   65.30%           
=======================================
  Files          17       17           
  Lines        1842     1842           
=======================================
  Hits         1203     1203           
  Misses        639      639           
Files Changed Coverage Δ
src/dscim/menu/simple_storage.py 93.03% <100.00%> (ø)
src/dscim/utils/utils.py 76.64% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@brews brews requested a review from kemccusker August 11, 2023 01:41
@brews brews marked this pull request as ready for review August 11, 2023 01:41
@brews
Copy link
Member Author

brews commented Aug 11, 2023

One of the fixes here is that you can no longer index with a dask-backed boolean array. Rather than refactoring I simply tacked on a .compute() so that the index is computed. One thing with this naive solution is this .compute() added to

lambda x: (x < 0).compute()

risks using too much memory if the input array is larger than memory. I don't know if large input arrays is a real problem here? I'd love for feedback on this.

@brews
Copy link
Member Author

brews commented Aug 15, 2023

While I'm thinking about it. Maybe we can replace all these .compute() lines and fancy checking with something really simple like:

    if (array <= 0).any():
        raise ValueError("Values in array are <= 0")

@JMGilbert
Copy link
Contributor

@kemccusker I did a full run through from reduced damages using this PR and replicated both risk aversion euler ramsey and equity euler ramsey.

@kemccusker
Copy link
Member

@kemccusker I did a full run through from reduced damages using this PR and replicated both risk aversion euler ramsey and equity euler ramsey.

Thanks, @JMGilbert !!

@brews brews merged commit 9edbf56 into main Sep 14, 2023
1 of 2 checks passed
@brews brews deleted the fix_xarray_update branch September 14, 2023 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updated xarray breaks dscim
3 participants