pyclustering
pyclustering copied to clipboard
change numpy.warnings to warnings in cluster/center_initializer.py
newer NumPy removes warnings module from the main namespace, therefore numpy.warnings results in error https://github.com/annoviko/pyclustering/blob/bf4f51a472622292627ec8c294eb205585e50f52/pyclustering/cluster/center_initializer.py#L248
Since warnings module is already imported here, the "numpy." specifier should be removed.
The change responsible in NumPy https://github.com/numpy/numpy/commit/118e6c433a9afdefbfad7652f56e2b97e23bc508
@karna48 agreed, as of numpy=1.24.0
numpy.warnings
has been removed. @annoviko please could you make the necessary changes to pyclustering. I'm also willing to submit a PR otherwise :)
Hi @KulikDM & @annoviko, can we merge the above PR to remove numpy.warnings
from the module? It is blocking my usage of pyclustering due to dependencies of needing numpy>1.24.0. Thanks!
Hi @marc-stamp not sure when the above PR will be merged. However, as an alternative you can install the repo with the fixed changes using pip install https://github.com/KulikDM/pyclustering/archive/Warning-Fix.zip
or you could fork the fixed repo and follow the same approach as above. Hope this helps!