Skip to content

Conversation

@guan404ming
Copy link
Member

No description provided.

@guan404ming guan404ming force-pushed the add-fallback-for-_call11 branch from ef4432d to 150a207 Compare March 23, 2025 15:46
@guan404ming guan404ming changed the title ♻️ add fallback for _Call11Isnat, _Call11Signbit ♻️ update _Call11bool definition Mar 23, 2025
@guan404ming guan404ming changed the title ♻️ update _Call11bool definition ♻️ update _Call11bool definition Mar 23, 2025
@guan404ming
Copy link
Member Author

guan404ming commented Mar 23, 2025

After investigation, I think isnat and signbit are not suitable to add fallback to return Any

>>> date1 = np.datetime64('2023-10-15')
>>> np.signbit(date1)
Traceback (most recent call last):
  File "<python-input-5>", line 1, in <module>
    np.signbit(date1)
    ~~~~~~~~~~^^^^^^^
TypeError: ufunc 'signbit' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
>>> np.isnat(123)
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    np.isnat(123)
    ~~~~~~~~^^^^^
TypeError: ufunc 'isnat' is only defined for np.datetime64 and np.timedelta64.

Thus, I just converted this PR only for enhancing _Call11bool

@guan404ming guan404ming changed the title ♻️ update _Call11bool definition ♻️ enhance _Call11bool Mar 23, 2025
@guan404ming guan404ming force-pushed the add-fallback-for-_call11 branch from 83d8907 to e477ba1 Compare March 24, 2025 02:05
@guan404ming guan404ming requested a review from jorenham March 24, 2025 02:55
@guan404ming guan404ming requested a review from jorenham March 24, 2025 14:03
@jorenham jorenham merged commit bf50183 into numpy:main Mar 24, 2025
21 checks passed
@jorenham jorenham added this to the v2.2.x.0 milestone Mar 24, 2025
@guan404ming guan404ming deleted the add-fallback-for-_call11 branch March 24, 2025 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants