Skip to content

Closes #3337: Fix can_cast with NumPy 2.0 breaking changes - #4136

Merged
ajpotts merged 1 commit into
Bears-R-Us:masterfrom
ajpotts:3337_Fix_can_cast_with_NumPy_2.0_breaking_changes
Mar 12, 2025
Merged

ajpotts merged 1 commit into
Bears-R-Us:masterfrom
ajpotts:3337_Fix_can_cast_with_NumPy_2.0_breaking_changes

Conversation

@ajpotts

@ajpotts ajpotts commented Mar 3, 2025 •

Copy link
Copy Markdown
Contributor

This PR adds a can_cast function to match numpy:
https://numpy.org/devdocs/reference/generated/numpy.can_cast.html

The casting argument is left to a separate ticket: #4107

Closes #3337: Fix can_cast with NumPy 2.0 breaking changes

@ajpotts
ajpotts force-pushed the 3337_Fix_can_cast_with_NumPy_2.0_breaking_changes branch from 0971a6b to 07e8a01 Compare March 3, 2025 17:30
@ajpotts
ajpotts marked this pull request as draft March 3, 2025 17:38
@ajpotts
ajpotts force-pushed the 3337_Fix_can_cast_with_NumPy_2.0_breaking_changes branch 2 times, most recently from 5b1d20b to 6e85630 Compare March 3, 2025 19:32
@ajpotts
ajpotts marked this pull request as ready for review March 3, 2025 19:33
@ajpotts
ajpotts force-pushed the 3337_Fix_can_cast_with_NumPy_2.0_breaking_changes branch from 6e85630 to ca7c9db Compare March 3, 2025 20:34

@1RyanK 1RyanK left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@ajpotts
ajpotts force-pushed the 3337_Fix_can_cast_with_NumPy_2.0_breaking_changes branch 3 times, most recently from b6eed52 to e00cd4a Compare March 12, 2025 14:07

@drculhane drculhane left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.

I know this comment "if cast between data types can occur according to the casting rule" is exactly what numpy says too, but I personally find it unhelpful. I don't see any reason not to approve the change, but I'm making a mental TODO to improve this.

@ajpotts
ajpotts added this pull request to the merge queue Mar 12, 2025
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Mar 12, 2025
@ajpotts
ajpotts force-pushed the 3337_Fix_can_cast_with_NumPy_2.0_breaking_changes branch from e00cd4a to 8b024a2 Compare March 12, 2025 19:42
@ajpotts
ajpotts added this pull request to the merge queue Mar 12, 2025
Merged via the queue into Bears-R-Us:master with commit 10a87c9 Mar 12, 2025
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.

Fix can_cast with NumPy 2.0 breaking changes

4 participants