Repository: nschloe/pyfma (language: python)

Issue:
Unmarked dependency on numpy.
Steps to reproduce:

1.  Make and activate a fresh virtualenv.
2. Install pyfma via pip
3. Run the command python -c "import pyfma; pyfma.fma(1,2,3)"

The result is `ModuleNotFoundError: No module named 'numpy'`.

What I expect is to either be able to use pyfma without numpy, or for pyfma to automatically have pip download and install numpy when I install pyfma. I'm not an expert at setuptools but I think the first case requires making numpy an [optional dependency](https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#optional-dependencies), while the second case requires making numpy a [required dependency](https://setuptools.readthedocs.io/en/latest/userguide/dependency_management.html#declaring-required-dependency).




Discussion / hints:

Fix patch:
diff --git a/setup.cfg b/setup.cfg
index 571bd53..4345b96 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
 [metadata]
 name = pyfma
-version = 0.1.3
+version = 0.1.4
 url = https://github.com/nschloe/pyfma
 author = Nico Schlömer
 author_email = nico.schloemer@gmail.com
@@ -27,6 +27,7 @@ package_dir =
 packages = find:
 install_requires =
     importlib_metadata;python_version<"3.8"
+    numpy
 python_requires = >=3.6
 
 [options.packages.find]


Test patch:
diff --git a/tests/test_det.py b/tests/test_det.py
new file mode 100644
index 0000000..821acbe
--- /dev/null
+++ b/tests/test_det.py
@@ -0,0 +1,23 @@
+import numpy as np
+
+import pyfma
+
+
+# See <https://www.johndcook.com/blog/2020/05/31/kahan-determinant/>
+def test_determinant():
+    a = np.pi
+    b = np.exp(1.0)
+    c = 355 / 113
+    d = 23225 / 8544
+    naive = a * d - b * c
+
+    ref = -7.039440870215685e-07
+    assert abs(naive - ref) < 1.0e-13
+
+    w = b * c
+    e = pyfma.fma(-b, c, w)
+    f = pyfma.fma(a, d, -w)
+    kahan = f + e
+
+    ref = -7.039440870215685e-07
+    assert abs(kahan - ref) < 1.0e-13