Skip to content

Commit

Permalink
pca: warn if numpy > 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacovercast committed Sep 22, 2024
1 parent c88e3c3 commit 3996302
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ipyrad/analysis/pca.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3996302

Please sign in to comment.