From 39963029c5915c6622becf3d79590c6b4f371286 Mon Sep 17 00:00:00 2001 From: Isaac Overcast Date: Sun, 22 Sep 2024 11:01:14 -0700 Subject: [PATCH] pca: warn if numpy > 2.0 --- ipyrad/analysis/pca.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ipyrad/analysis/pca.py b/ipyrad/analysis/pca.py index bbac210d..cbe2aa3d 100644 --- a/ipyrad/analysis/pca.py +++ b/ipyrad/analysis/pca.py @@ -55,6 +55,13 @@ this value. """ +_NUMPY_VERSION_ERROR = """ +PCA module requires numpy < 2.0.0 (see issue #578). Roll back to a +supported version of numpy. + +conda install -c conda-forge numpy\<2.0.0 +""" + # TODO: could allow LDA as alternative to PCA for supervised (labels) dsets. @@ -120,6 +127,8 @@ def __init__( raise IPyradError(_MISSING_SKLEARN) if not sys.modules.get("toyplot"): raise IPyradError(_MISSING_TOYPLOT) + if np.lib.NumpyVersion(np.__version__) >= '2.0.0': + raise IPyradError(_NUMPY_VERSION_ERROR) # init attributes self.quiet = quiet