annoviko / pyclustering

pyclustering is a Python, C++ data mining library.
https://pyclustering.github.io/
BSD 3-Clause "New" or "Revised" License
1.16k stars 249 forks source link

change numpy.warnings to warnings in cluster/center_initializer.py #696

Open karna48 opened 1 year ago

karna48 commented 1 year ago

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

KulikDM commented 1 year ago

@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 :)

marc-stamp commented 1 year ago

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!

KulikDM commented 1 year ago

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!