From b2353370d77df5b4a812bf95784fcb1b559e722d Mon Sep 17 00:00:00 2001 From: Bhavnesh Jangid Date: Sat, 7 Oct 2023 22:59:34 -0500 Subject: [PATCH 1/3] np version check fix --- lib/helper.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/helper.py b/lib/helper.py index d74aba3b..5d78691c 100644 --- a/lib/helper.py +++ b/lib/helper.py @@ -1,10 +1,16 @@ import sys, os import numpy + +def version_tuple(version): + return tuple(map(int, version.split('.'))) + + ''' This bit copied from PySCF ''' def load_library(libname): # numpy 1.6 has bug in ctypeslib.load_library, see numpy/distutils/misc_util.py - if '1.6' in numpy.__version__: + if version_tuple(numpy.__version__) <= version_tuple('1.6'): + #if '1.6' in numpy.__version__: if (sys.platform.startswith('linux') or sys.platform.startswith('gnukfreebsd')): so_ext = '.so' From f29030937a22e7d48ee895e3181290bfcdd9f738 Mon Sep 17 00:00:00 2001 From: Bhavnesh Jangid <85997686+JangidBhavnesh@users.noreply.github.com> Date: Mon, 9 Oct 2023 13:06:11 -0500 Subject: [PATCH 2/3] Typo --- lib/helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/helper.py b/lib/helper.py index 5d78691c..cdb4293c 100644 --- a/lib/helper.py +++ b/lib/helper.py @@ -9,7 +9,7 @@ def version_tuple(version): ''' This bit copied from PySCF ''' def load_library(libname): # numpy 1.6 has bug in ctypeslib.load_library, see numpy/distutils/misc_util.py - if version_tuple(numpy.__version__) <= version_tuple('1.6'): + if version_tuple(numpy.__version__) <= version_tuple('1.6.2'): #if '1.6' in numpy.__version__: if (sys.platform.startswith('linux') or sys.platform.startswith('gnukfreebsd')): From 83eb0904220a1a327c9b29ea07912caf5f0ef871 Mon Sep 17 00:00:00 2001 From: Bhavnesh Jangid <85997686+JangidBhavnesh@users.noreply.github.com> Date: Mon, 9 Oct 2023 14:56:01 -0500 Subject: [PATCH 3/3] Typo --- lib/helper.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/helper.py b/lib/helper.py index cdb4293c..f0fbf82e 100644 --- a/lib/helper.py +++ b/lib/helper.py @@ -3,14 +3,13 @@ def version_tuple(version): - return tuple(map(int, version.split('.'))) + return tuple(map(int, version.split('.')))[:2] ''' This bit copied from PySCF ''' def load_library(libname): # numpy 1.6 has bug in ctypeslib.load_library, see numpy/distutils/misc_util.py - if version_tuple(numpy.__version__) <= version_tuple('1.6.2'): - #if '1.6' in numpy.__version__: + if version_tuple(numpy.__version__) == version_tuple('1.6.2'): if (sys.platform.startswith('linux') or sys.platform.startswith('gnukfreebsd')): so_ext = '.so'