Describe the issue:
19ba7c4 (#22707) broke string comparison between unyt.unyt_quantity object (fancy 0d numpy arrays with unit data), and strings.
The following minimal example used to be fine, but it crashes on the main branch of numpy
Reproduce the code example:
import unyt as un
a = 1 * un.cm
assert a != "hello"
Error message:
-traceback
Traceback (most recent call last):
File "/Users/robcleme/dev/numpy/t.py", line 4, in <module>
assert a != "hello"
^^^^^^^^^^^^
File "/Users/robcleme/.pyenv/versions/numpy-dev/lib/python3.11/site-packages/unyt/array.py", line 1850, in __array_ufunc__
new_dtype = np.dtype("f" + str(inp1.dtype.itemsize))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: data type 'f20' not understood
NumPy/Python version information:
Python 3.11.0
Context for the issue:
This change of behaviour breaks yt, see yt-project/yt#4241
I note that we haven't captured this regression via unyt's on CI, so I'll add a test there. (edit: this is yt-project/unyt#333)
It is unclear to me why this is happening, and I am not sure which of numpy or unyt this bug should be fixed in.
Ping @ngoldbaum for information
Describe the issue:
19ba7c4 (#22707) broke string comparison between
unyt.unyt_quantityobject (fancy 0d numpy arrays with unit data), and strings.The following minimal example used to be fine, but it crashes on the main branch of
numpyReproduce the code example:
Error message:
NumPy/Python version information:
Python 3.11.0
Context for the issue:
This change of behaviour breaks
yt, see yt-project/yt#4241I note that we haven't captured this regression via(edit: this is yt-project/unyt#333)unyt's on CI, so I'll add a test there.It is unclear to me why this is happening, and I am not sure which of
numpyorunytthis bug should be fixed in.Ping @ngoldbaum for information