From 40e2e215fe9de85a15cea87fca0c5c4d3243f54a Mon Sep 17 00:00:00 2001 From: Tim Keil Date: Mon, 14 Nov 2022 13:58:23 +0100 Subject: [PATCH 1/3] [README] Add an explanation for installing scikit-sparse properly --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c5238fa..066d968 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,20 @@ usage. ## Required packages -These packages might be needed: +These `python` packages are needed: * `scikit-sparse` * `numpy` * `scipy` +For installing [`scikit-sparse`](https://github.com/scikit-sparse/scikit-sparse), +the library `suite-sparse` is required. +As also highlighted [here](https://github.com/scikit-sparse/scikit-sparse), +there may appear problems installing `scikit-sparse` on a Mac, +which is due to the `suite-sparse` location not being installed at the right place. +For fixing this, just find out your `lib` and `include` directory of your `suite-sparse` +and use the respective `pip install` command which defines +`SUITESPARSE_INCLUDE_DIR` and `SUITESPARSE_LIBRARY_DIR` manually. + ## Getting started You can find some examples on how to use it in the test directory `test`. See e.g. the example in `gridlod/test/test_pgexamples.py`. The @@ -85,4 +94,4 @@ illustrative. Use e.g. `nosetests` to run the tests. ## Contributors * Fredrik Hellman -* Tim Keil +* Tim Keil \ No newline at end of file From 3c34af48bd97dc6693c4084a4a56ff319203badd Mon Sep 17 00:00:00 2001 From: Tim Keil Date: Mon, 14 Nov 2022 13:58:41 +0100 Subject: [PATCH 2/3] [func] resolve numpy warnings --- gridlod/func.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gridlod/func.py b/gridlod/func.py index 1ec58dc..a4c0f19 100644 --- a/gridlod/func.py +++ b/gridlod/func.py @@ -56,7 +56,7 @@ def evaluateCQ1(N, cq1, coordinates): interpolationWeights = np.zeros((coordinates.shape[0], 2**d)) for localNode in range(2**d): localNodeBinaryString = bin(localNode)[2:].zfill(d)[::-1] - localNodeBitmap = np.array([0 if bit is '0' else 1 for bit in localNodeBinaryString]) + localNodeBitmap = np.array([0 if bit == '0' else 1 for bit in localNodeBinaryString]) # This computes the value of the basis function at node # localNode for all points. It is a product of either x_k or @@ -97,7 +97,7 @@ def evaluateCQ1D(N, cq1, coordinates): interpolationWeights = np.zeros((coordinates.shape[0], 2**d, d)) for localNode in range(2**d): localNodeBinaryString = bin(localNode)[2:].zfill(d)[::-1] - localNodeBitmap = np.array([0 if bit is '0' else 1 for bit in localNodeBinaryString]) + localNodeBitmap = np.array([0 if bit == '0' else 1 for bit in localNodeBinaryString]) for dimensionToDifferentiate in range(d): # These are the factors x_k or (1-x_k) interpolationWeightsFactors = (1.0 - localNodeBitmap) + (2.0*localNodeBitmap - 1.0)*coordIndicesFpart From d5e11774ef9d300a445fc50f78ce05e96093a057 Mon Sep 17 00:00:00 2001 From: Tim Keil Date: Mon, 14 Nov 2022 13:59:03 +0100 Subject: [PATCH 3/3] add requirements --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..87506df --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +numpy==1.23.4 +scikit-sparse==0.4.7 +scipy==1.9.3