v923z / micropython-ulab

a numpy-like fast vector module for micropython, circuitpython, and their derivatives
https://micropython-ulab.readthedocs.io/en/latest
MIT License
432 stars 117 forks source link

[BUG] sorting of complex arrays causes crash #581

Closed v923z closed 1 year ago

v923z commented 1 year ago

As mentioned in https://github.com/v923z/micropython-ulab/issues/579, sort_complex results in a crash.


try:
    from ulab import numpy as np
except:
    import numpy as np

dtypes = (np.uint8, np.int8, np.uint16, np.int16, np.float, np.complex)

for dtype in dtypes:
    print(np.sort_complex(np.array(range(5, 0, 81), dtype=dtype)))