From 2da7549d9967ed419c1f5227a68a4c39f2d6f048 Mon Sep 17 00:00:00 2001 From: Sylvain Tricot Date: Mon, 7 Mar 2022 14:15:23 +0100 Subject: [PATCH 1/3] Fixed ModuleNotFoundError during 'make'. The eps.so was loaded by __init__.py during making the shared object and was obviously not found. The import is now enclose in a try...except block to avoid raising an exception. --- src/python/msspec_dfm/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/python/msspec_dfm/__init__.py b/src/python/msspec_dfm/__init__.py index d52165f..a3a6446 100644 --- a/src/python/msspec_dfm/__init__.py +++ b/src/python/msspec_dfm/__init__.py @@ -21,4 +21,7 @@ # Committed by : Sylvain Tricot 1645806435 +0100 from msspec_dfm.version import __version__ -from msspec_dfm.compute import compute +try: + from msspec_dfm.compute import compute +except ModuleNotFoundError as err: + pass From babfb58a076e798c134cf608d760cd86a7a7dd8e Mon Sep 17 00:00:00 2001 From: Sylvain Tricot Date: Mon, 7 Mar 2022 14:17:20 +0100 Subject: [PATCH 2/3] Fixed bug 'plot_type' not found. The variable 'plot_type' was changed to 'stem'. --- examples/example00.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/example00.py b/examples/example00.py index 8f8dfd0..e98360e 100644 --- a/examples/example00.py +++ b/examples/example00.py @@ -45,7 +45,8 @@ for d in densities: # compute the corresponding averaged radius (in Bohr units) rs = ( (1/d) / ((4/3) * np.pi) ) ** (1/3) / a0 # Some output printing - print("Computing {} for RS={}".format(plot_type, rs)) + stem = 'plas_disp' + print("Computing {} for RS={}".format(stem, rs)) # Here is the actual call to calculate data = compute(N_Q=100, RS=rs, T=T) # 'data' is a dict, each key is the name of an output file (without extansion). @@ -53,7 +54,7 @@ for d in densities: # the number of points chosen and on the kind of output file. # Reading data - X, Y = data['plas_disp'].T + X, Y = data[stem].T # Plotting plt.plot(X, Y, label=r'density={:.2e} $e/cm^3$'.format(d)) From cf778b90ccc4c7d27d09c738f6afbf36a7ba8f89 Mon Sep 17 00:00:00 2001 From: Sylvain Tricot Date: Mon, 7 Mar 2022 14:38:14 +0100 Subject: [PATCH 3/3] Added matplotlib as required in 'make all' target. ... otherwise click-man cannot proceed. --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index aa8943f..2540d34 100644 --- a/src/Makefile +++ b/src/Makefile @@ -280,7 +280,7 @@ pypkg: python/dist/$(PYTHON_PKG_NAME)-$(VERSION).tar.gz required_python_packages: - @$(PIP) install numpy click-man + @$(PIP) install numpy matplotlib click-man python/VERSION: