Repository: ami-iit/adam (language: python)

Issue:
Numpy error when install ADAM via pip on 20.04 with python3-numpy apt package installed
I am installing ADAM via the installation process, and the following error is printed:
~~~
ERROR: jaxlib 0.1.73 has requirement numpy>=1.18, but you'll have numpy 1.17.4 which is incompatible.
ERROR: jax 0.2.25 has requirement numpy>=1.18, but you'll have numpy 1.17.4 which is incompatible.
~~~

It seems that pip finds the `numpy` installed via apt and so does not installs it in the virtualenv, but then it complains that the version is not correct. 


Discussion / hints:
While testing the examples, all of them fail with:
~~~
ModuleNotFoundError: No module named 'numpy.typing'
~~~

So I guess that indeed there is a dependency on a specific numpy version?
Hi @traversaro!
 
> So I guess that indeed there is a dependency on a specific numpy version?

Indeed, it seems! 

Also, which version of python are you using?
> Also, which version of python are you using?

~~~
traversaro@IITICUBLAP257:~$ python3
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
~~~
@traversaro sorry for the late response! Do you think that bumping the NumPy version to > 1.18 in the [`setup.cfg`](https://github.com/ami-iit/ADAM/blob/main/setup.cfg) would solve the problem?
> Do you think that bumping the NumPy version to > 1.18 in the [`setup.cfg`](https://github.com/ami-iit/ADAM/blob/main/setup.cfg) would solve the problem?

I do not know. I tried to apply:
~~~
(adamenv) traversaro@IITICUBLAP257:~/ADAM$ git diff
diff --git a/setup.cfg b/setup.cfg
index cc135cd..cedd2c6 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -9,7 +9,7 @@ license_file = LICENSE
 packages = find:
 python_requires = >=3.7
 install_requires =
-        numpy
+        numpy >= 1.18
         scipy
         casadi
         matplotlib
~~~

and installing with `pip install .` in a clean environment indeed installs numpy 1.21, but if I then stash the modifications and install again, numpy 1.21 is again installed, so I am not sure what is happening here (I am not a big pip expert to be honest).

Fix patch:
diff --git a/setup.cfg b/setup.cfg
index cc135cd7..83f25bbb 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,18 +4,33 @@ description = Automatic Differentiation for rigid body AlgorithMs
 author = "Giuseppe L'Erario"
 author_email = gl.giuseppelerario@gmail.com
 license_file = LICENSE
+url = https://github.com/ami-iit/ADAM
+
+keywords =
+    robotics
+    urdf
+    rigid body dynamics
+    featherstone
+    automatic-differentiation
+    optimization
+    casadi
+    jax
+    pytorch
+    reinforcement-learning
+    motion-planning
 
 [options]
 packages = find:
-python_requires = >=3.7
+python_requires = >=3.8
 install_requires =
-        numpy
+        jax
+        jaxlib
+        numpy >=1.20
         scipy
         casadi
         matplotlib
         prettytable
         urdf_parser_py
-        jax[cpu]
         torch
 
 [options.extras_require]


Test patch:
diff --git a/tests/test_Jax_computations.py b/tests/test_Jax_computations.py
index b553547f..5a63cd49 100644
--- a/tests/test_Jax_computations.py
+++ b/tests/test_Jax_computations.py
@@ -193,7 +193,5 @@ def test_gravity_term():
     G_iDyn_np = np.concatenate(
         (G_iDyn.baseWrench().toNumPy(), G_iDyn.jointTorques().toNumPy())
     )
-    print(G_iDyn_np)
     G_test = comp.gravity_term(H_b, s_)
-    print(G_test)
     assert G_iDyn_np - G_test == pytest.approx(0.0, abs=1e-4)
diff --git a/tests/test_NumPy_computations.py b/tests/test_NumPy_computations.py
index 4adcfad5..b90d2893 100644
--- a/tests/test_NumPy_computations.py
+++ b/tests/test_NumPy_computations.py
@@ -192,7 +192,5 @@ def test_gravity_term():
     G_iDyn_np = np.concatenate(
         (G_iDyn.baseWrench().toNumPy(), G_iDyn.jointTorques().toNumPy())
     )
-    print(G_iDyn_np)
     G_test = comp.gravity_term(H_b, s_)
-    print(G_test)
     assert G_iDyn_np - G_test == pytest.approx(0.0, abs=1e-4)