Skip to content

Conversation

@rcomer
Copy link
Member

@rcomer rcomer commented Nov 12, 2025

🚀 Pull Request

Description

Fixes #6738, or at least it fixes my use case 😉

The coordinate's modulus is a python float. It seems that at numpy v1 doing arithmetic between a np.float32 and a float gave a np.float64. At numpy v2 it quite reasonably gives a np.float32, but that means we are now calculating at lower precision than we were. Making the modulus into a np.float64 seems like the simplest way to reinstate the previous behaviour.


Consult Iris pull request check list


Add any of the below labels to trigger actions on this PR:

  • benchmark_this Request that this pull request be benchmarked to check if it introduces performance shifts

@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.39%. Comparing base (20e4d88) to head (13f9d4f).
⚠️ Report is 2 commits behind head on v3.14.x.

Additional details and impacted files
@@           Coverage Diff            @@
##           v3.14.x    #6793   +/-   ##
========================================
  Coverage    90.39%   90.39%           
========================================
  Files           91       91           
  Lines        24761    24763    +2     
  Branches      4639     4639           
========================================
+ Hits         22382    22384    +2     
  Misses        1608     1608           
  Partials       771      771           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rcomer rcomer force-pushed the numpy2-guess_bounds branch from 40a398d to 336a21d Compare November 13, 2025 11:38
@trexfeathers trexfeathers self-assigned this Nov 13, 2025
Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this @rcomer! I have one suggestion, for honouring the original dtype instead of always using float64.

@trexfeathers
Copy link
Contributor

Great, thanks! Once we've got v3.14.0 out tomorrow I will get this merged into v3.14.x.

In case it isn't clear: I can't merge it now because that would mean cutting a new release candidate and waiting another two weeks.

@trexfeathers trexfeathers marked this pull request as draft November 13, 2025 15:08
@rcomer
Copy link
Member Author

rcomer commented Nov 13, 2025

Thanks @trexfeathers - I didn't know about promote_types, so I've learned something along the way 😎

@trexfeathers trexfeathers changed the base branch from main to v3.14.x November 13, 2025 15:11
@trexfeathers trexfeathers changed the base branch from v3.14.x to main November 13, 2025 15:11
@rcomer
Copy link
Member Author

rcomer commented Nov 13, 2025

Do I need to rebase against v3.14.x? Also will the whatnew need to move?

@trexfeathers trexfeathers changed the base branch from main to v3.14.x November 13, 2025 15:14
@rcomer rcomer force-pushed the numpy2-guess_bounds branch from 0e5790b to 13f9d4f Compare November 13, 2025 15:32
@rcomer
Copy link
Member Author

rcomer commented Nov 13, 2025

I have attempted to follow the pattern of recent patches for the whatsnew.

@trexfeathers trexfeathers marked this pull request as ready for review November 14, 2025 16:31
@trexfeathers trexfeathers merged commit c4a7642 into SciTools:v3.14.x Nov 14, 2025
21 checks passed
@rcomer rcomer deleted the numpy2-guess_bounds branch November 14, 2025 16:55
@rcomer
Copy link
Member Author

rcomer commented Nov 14, 2025

Thank you for being so accommodating @trexfeathers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

guess_bounds output sensitive to numpy version

2 participants