ddbourgin / numpy-ml

Machine learning, in numpy
https://numpy-ml.readthedocs.io/
GNU General Public License v3.0
15.26k stars 3.7k forks source link

Import of collections.Hashable fails in Python 3.10 #79

Open PTriebold opened 1 year ago

PTriebold commented 1 year ago

System information

Describe the current behavior import of numpy_ml fails due to an ImportError with the collections module.

Describe the expected behavior Importing just the module should not generate an ImportError

Code to reproduce the issue

# Python 3.10 or newer
import numpy_ml

Other info / logs In Python 3.10 the deprecated aliases were removed.

Remove deprecated aliases to Collections Abstract Base Classes from the collections module. (Contributed by Victor Stinner in bpo-37324.)

from What’s New In Python 3.10

fix To fix the bug, in /numpy_ml/utils/data_structures.py change

from collections import Hashable

to

from collections.abc import Hashable
idanh commented 1 year ago

@ddbourgin any chance this will be fixed to support python 3.10? Thanks

msf235 commented 1 year ago

@ddbourgin any chance this will be fixed to support python 3.10? Thanks

I created a pull request https://github.com/ddbourgin/numpy-ml/pull/85 to address this.

chiarcos commented 9 months ago

Could someone take a look at the pull request, maybe?