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
BUG: Remove complex floor divide #19135
BUG: Remove complex floor divide #19135
Conversation
…rts for divmod and remainder
@@ -1317,7 +1317,7 @@ def test_minmax_dtypes(self): | |||
dtype=float_dtype) | |||
assert_equal(zm.min(), float_dtype(-np.inf-1j)) | |||
assert_equal(zm.max(), float_dtype(np.inf+2j)) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really need to change my .vimrc one day
32582d8
to
d4765ee
Compare
@kaivu1999 didn't cross my mind to check with you before raising this. If you see this before the review for this code is done, please feel free to re-open your PR and add the extra changes I have made to fix the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of places in the stub files that still contain references to complex floordivision:
Lines 2310 to 2311 in 9fcc132
@overload | |
def __floordiv__(self: _ArrayComplex_co, other: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]: ... # type: ignore[misc] |
Lines 2338 to 2339 in 9fcc132
@overload | |
def __rfloordiv__(self: _ArrayComplex_co, other: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]: ... # type: ignore[misc] |
Lines 3258 to 3259 in 9fcc132
__floordiv__: _ComplexOp[_NBit1] | |
__rfloordiv__: _ComplexOp[_NBit1] |
The same holds for the typing tests in reveal/arithmetic.py and pass/arithmetic.py.
Thanks @BvB93, I'll remove those as well. I wanted to understand how and where the three references in |
Yeah, that makes sense actually. Each of these Complex is at the end of this tree though (as it cannot be safely cast into any other type), so removing it means that complex operations are no longer allowed. Lines 2016 to 2021 in 9fcc132
|
Thanks! Always wondered where the casting order is taken care for arrays. |
672fb9f
to
f59e225
Compare
Hey folks, any changes needed here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know if this will have implications for scipy/astropy/pandas?
Will building them with this branch of NumPy help? Will be happy to do so. |
Thanks @ganesh-k13 .Lets get this in for testing at least. |
Changes:
floor_divide
for all complex typesfloor_divde
TC to check forTypeError
. Added same for divmod and remainder.test_core
to checkTypeError
raised for unsupported types.TODO:
closes: #13236
finishes: #13245 (work done by @kaivu1999)