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

[ENH ] Numpy 2.0 compatibility #276

Merged
merged 1 commit into from
Jul 19, 2024
Merged

Conversation

ales-erjavec
Copy link
Collaborator

@ales-erjavec ales-erjavec commented Jul 11, 2024

Issue

Numpy 2.0 changes scalar repr as per https://numpy.org/neps/nep-0051-scalar-representation.html

This adds many np.float64(...) to generated matplotlib_export code.

Description of changes

Make matplotlib_export convert to python scalars where appropriate to avoid 'np.*' in generated code.

Includes
  • Code changes
  • Tests
  • Documentation

@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.79%. Comparing base (df37822) to head (513f894).

Files Patch % Lines
orangewidget/utils/matplotlib_export.py 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #276      +/-   ##
==========================================
+ Coverage   71.77%   71.79%   +0.01%     
==========================================
  Files          34       34              
  Lines        9107     9114       +7     
==========================================
+ Hits         6537     6543       +6     
- Misses       2570     2571       +1     

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

Numpy 2.0 changes scalar repr as per:

     https://numpy.org/neps/nep-0051-scalar-representation.html

Make matplotlib_export convert to python scalars where appropriate
to avoid 'np.*' in generated code.
@markotoplak
Copy link
Member

Seems OK. I tested this with the numpy2 branch from orange3.

@markotoplak markotoplak merged commit 9ae212f into biolab:master Jul 19, 2024
22 of 23 checks passed
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.

3 participants