pyclustering icon indicating copy to clipboard operation
pyclustering copied to clipboard

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

Open karna48 opened this issue 1 year ago • 3 comments

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 avatar Mar 02 '23 12:03 karna48

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

KulikDM avatar May 02 '23 19:05 KulikDM

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!

marc-stamp avatar Aug 30 '23 11:08 marc-stamp

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!

KulikDM avatar Aug 30 '23 16:08 KulikDM