From 5b4403bfda424ff2dc342e229095af2dc24ea8f3 Mon Sep 17 00:00:00 2001 From: James Krieger Date: Thu, 19 Sep 2024 12:11:43 +0200 Subject: [PATCH 1/4] eigh evd when no turbo --- prody/utilities/eigtools.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/prody/utilities/eigtools.py b/prody/utilities/eigtools.py index ef8b141af..a40027eca 100644 --- a/prody/utilities/eigtools.py +++ b/prody/utilities/eigtools.py @@ -40,7 +40,13 @@ def _eigh(M, eigvals=None, turbo=True): if eigvals: turbo = False if not issparse(M): - values, vectors = linalg.eigh(M, turbo=turbo, eigvals=eigvals) + if hasattr('linalg.eigh', 'turbo'): + values, vectors = linalg.eigh(M, turbo=turbo, eigvals=eigvals) + else: + if turbo: + values, vectors = linalg.eigh(M, driver='evd', eigvals=eigvals) + else: + values, vectors = linalg.eigh(M, eigvals=eigvals) else: try: from scipy.sparse import linalg as scipy_sparse_la From 4ae9d107276b69399ca6e251c7ceddb94f44f632 Mon Sep 17 00:00:00 2001 From: James Krieger Date: Thu, 19 Sep 2024 12:47:29 +0200 Subject: [PATCH 2/4] try except turbo --- prody/utilities/eigtools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prody/utilities/eigtools.py b/prody/utilities/eigtools.py index a40027eca..875439ebb 100644 --- a/prody/utilities/eigtools.py +++ b/prody/utilities/eigtools.py @@ -40,9 +40,9 @@ def _eigh(M, eigvals=None, turbo=True): if eigvals: turbo = False if not issparse(M): - if hasattr('linalg.eigh', 'turbo'): + try: values, vectors = linalg.eigh(M, turbo=turbo, eigvals=eigvals) - else: + except AttributeError: if turbo: values, vectors = linalg.eigh(M, driver='evd', eigvals=eigvals) else: From 49a37142eff5538ebdc843ef6975eca5850d6f29 Mon Sep 17 00:00:00 2001 From: James Krieger Date: Thu, 19 Sep 2024 13:00:58 +0200 Subject: [PATCH 3/4] replace eigvals --- prody/utilities/eigtools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/prody/utilities/eigtools.py b/prody/utilities/eigtools.py index 875439ebb..543e71c01 100644 --- a/prody/utilities/eigtools.py +++ b/prody/utilities/eigtools.py @@ -42,11 +42,11 @@ def _eigh(M, eigvals=None, turbo=True): if not issparse(M): try: values, vectors = linalg.eigh(M, turbo=turbo, eigvals=eigvals) - except AttributeError: + except TypeError: if turbo: - values, vectors = linalg.eigh(M, driver='evd', eigvals=eigvals) + values, vectors = linalg.eigh(M, driver='evd', subset_by_index=eigvals) else: - values, vectors = linalg.eigh(M, eigvals=eigvals) + values, vectors = linalg.eigh(M, subset_by_index=eigvals) else: try: from scipy.sparse import linalg as scipy_sparse_la From 6b3f753947a9e2fb830963663ae2f1e3a510af0d Mon Sep 17 00:00:00 2001 From: James Krieger Date: Thu, 19 Sep 2024 13:04:05 +0200 Subject: [PATCH 4/4] unlimit scipy --- pyproject.toml | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 40aa5e374..146e85d9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,2 @@ [build-system] -requires = ["setuptools", "wheel", "numpy>=1.10,<1.25", "pyparsing<=3.1.1", "scipy<=1.13.1"] +requires = ["setuptools", "wheel", "numpy>=1.10,<1.24", "pyparsing<=3.1.1", "scipy"] diff --git a/setup.py b/setup.py index f85413b04..8afb6a805 100644 --- a/setup.py +++ b/setup.py @@ -14,9 +14,9 @@ sys.exit() if sys.version_info[:2] == (2, 7) or sys.version_info[:2] <= (3, 5): - INSTALL_REQUIRES=['numpy>=1.10,<1.25', 'biopython<=1.76', 'pyparsing', 'scipy'] + INSTALL_REQUIRES=['numpy>=1.10', 'biopython<=1.76', 'pyparsing', 'scipy'] else: - INSTALL_REQUIRES=['numpy>=1.10,<1.24', 'biopython', 'pyparsing<=3.1.1', 'scipy<=1.13.1', 'setuptools'] + INSTALL_REQUIRES=['numpy>=1.10,<1.24', 'biopython', 'pyparsing<=3.1.1', 'scipy', 'setuptools'] if sys.version_info[0] == 3 and sys.version_info[1] < 6: sys.stderr.write('Python 3.5 and older is not supported\n')