v7labs / upolygon

Draw / find polygons fast without opencv, useful in machine learning pipelines.
MIT License
22 stars 2 forks source link

Numpy >= 1.24.0 not supported due to np.int #11

Open robin-maillot opened 1 year ago

robin-maillot commented 1 year ago

There is an np.int import in run_length_encoding.pyx which breaks when using numpy >= 1.24.0

Error:

>>> rle_encode(m)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "upolygon/run_length_encoding.pyx", line 12, in upolygon.run_length_encoding.rle_encode
  File "/home/robin/tc/software/services/machine-learning/.venv/lib/python3.8/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'int'
owencjones commented 1 year ago

Hi Robin,

Thanks for raising this, we've currently pinned the numpy version at 1.23.0 for this reason, and have a task in to address soon the refactor necessary to allow this to upgrade back to our usual policy of latest-version.

Unfortunately, this does mean that if you have clashing versions, these are harder to make coexist, depending how you manage your dependencies.

Whilst numpy made this announcement in advance, the inclusion of it in a minor version upgrade was a surprise to me! It's a priority for the team and I to address. Thanks for your issue report.

Any further issues, please let me know.

Owen