From 4a47099d6c7559c096f202523e979425c2150b96 Mon Sep 17 00:00:00 2001 From: Matteo Visconti di Oleggio Castello Date: Fri, 21 Jun 2024 14:41:17 -0700 Subject: [PATCH] FIX ComplexWarning for numpy>=1.26 --- himalaya/validation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/himalaya/validation.py b/himalaya/validation.py index 78e3d08..969f008 100644 --- a/himalaya/validation.py +++ b/himalaya/validation.py @@ -2,7 +2,10 @@ import warnings import numpy as np -from numpy.core.numeric import ComplexWarning +try: + from numpy.core.numeric import ComplexWarning +except ImportError: + from numpy.exceptions import ComplexWarning try: from scipy.sparse import issparse