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

🩹 Use svd function on raw numpy arrray instead of xarray dataarray #1520

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

jsnel
Copy link
Member

@jsnel jsnel commented Aug 25, 2024

This should fix an issues with numpy > 2.0.1 and should be backwards compatible.

Change summary

  • In the prepare_dataset function where svd are added we use the .data attribute of the xarrray dataarray to get the numpy array to be used in the calculation.

Checklist

  • ✔️ Passing the tests (mandatory for all PR's)
  • ✔️Test with both numpy 2.0.1 and numpy 1.26.4

Copy link

codecov bot commented Aug 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.8%. Comparing base (2c88dce) to head (3885447).
Report is 29 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1520     +/-   ##
=======================================
+ Coverage   88.6%   88.8%   +0.1%     
=======================================
  Files        107     109      +2     
  Lines       5128    5245    +117     
  Branches     962     982     +20     
=======================================
+ Hits        4544    4658    +114     
  Misses       468     468             
- Partials     116     119      +3     

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


🚨 Try these New Features:

@jsnel jsnel marked this pull request as ready for review August 25, 2024 14:05
@jsnel jsnel requested a review from a team as a code owner August 25, 2024 14:05
Copy link
Contributor

sourcery-ai bot commented Aug 25, 2024

🧙 Sourcery has finished reviewing your pull request!


Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

This should fix an issues with numpy > 2.0.1 and should be backwards compatible.
@jsnel jsnel force-pushed the fix_numpy_2_issues branch from 499bb5c to 3885447 Compare August 25, 2024 14:06
Copy link

@jsnel
Copy link
Member Author

jsnel commented Aug 25, 2024

I manually tested with both numpy 2.0.1 and numpy 1.26.4, running all examples notebooks, and observed no failing cell executions.

Copy link
Member

@s-weigand s-weigand left a comment

Choose a reason for hiding this comment

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

Thanks this will enable compatibility with numpy>2 (as far as numba also supports it) 🎉

@s-weigand s-weigand merged commit f9d8984 into glotaran:main Aug 25, 2024
38 checks passed
@s-weigand s-weigand deleted the fix_numpy_2_issues branch August 25, 2024 14:17
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.

2 participants