From da886d62de77e9b762071ce47f78d76554d7e21e Mon Sep 17 00:00:00 2001 From: Giuseppe L'Erario Date: Tue, 2 Sep 2025 13:05:33 +0000 Subject: [PATCH 1/6] Fix jax version to 0.6.0 in dependencies --- ci_env.yml | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci_env.yml b/ci_env.yml index c07afa39..c75bcd41 100644 --- a/ci_env.yml +++ b/ci_env.yml @@ -16,7 +16,7 @@ dependencies: - pytest-repeat - icub-models - idyntree >=11.0.0 - - jax + - jax==0.6.0 - pytorch - jax2torch - requests diff --git a/pyproject.toml b/pyproject.toml index 77083b0e..0b48c15b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ jax = ["jax", "jaxlib"] casadi = ["casadi"] pytorch = ["torch", "jax", "jaxlib", "jax2torch"] test = [ - "jax", + "jax==0.6.0" "jaxlib", "casadi", "torch", From 7fa17fa1ce97a87feb2c0cd09accd86cebcd02b9 Mon Sep 17 00:00:00 2001 From: Giuseppe L'Erario Date: Tue, 2 Sep 2025 13:09:15 +0000 Subject: [PATCH 2/6] Fix wrong jax version placement --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0b48c15b..3f251ae8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,11 +34,11 @@ dependencies = [ ] [project.optional-dependencies] -jax = ["jax", "jaxlib"] +jax = ["jax==0.6.0", "jaxlib"] casadi = ["casadi"] pytorch = ["torch", "jax", "jaxlib", "jax2torch"] test = [ - "jax==0.6.0" + "jax" "jaxlib", "casadi", "torch", From 252efbf0cbad5aee19c009dd2a5153237d23a365 Mon Sep 17 00:00:00 2001 From: Giuseppe L'Erario Date: Tue, 2 Sep 2025 13:11:37 +0000 Subject: [PATCH 3/6] Fix jax version in test dependencies to 0.6.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3f251ae8..567ca7c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ jax = ["jax==0.6.0", "jaxlib"] casadi = ["casadi"] pytorch = ["torch", "jax", "jaxlib", "jax2torch"] test = [ - "jax" + "jax==0.6.0" "jaxlib", "casadi", "torch", From 2a25fa07d75454fbc7648e50f3803f018c92bc76 Mon Sep 17 00:00:00 2001 From: Giuseppe L'Erario Date: Tue, 2 Sep 2025 13:12:41 +0000 Subject: [PATCH 4/6] Add missing comma --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 567ca7c0..37fe3d62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ jax = ["jax==0.6.0", "jaxlib"] casadi = ["casadi"] pytorch = ["torch", "jax", "jaxlib", "jax2torch"] test = [ - "jax==0.6.0" + "jax==0.6.0", "jaxlib", "casadi", "torch", From 4242a405578e1b1032b7d0591414646e72e67294 Mon Sep 17 00:00:00 2001 From: Giuseppe L'Erario Date: Tue, 2 Sep 2025 14:56:13 +0000 Subject: [PATCH 5/6] Formatted with black --- src/adam/casadi/inverse_kinematics.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/adam/casadi/inverse_kinematics.py b/src/adam/casadi/inverse_kinematics.py index e52487d1..a233d53f 100644 --- a/src/adam/casadi/inverse_kinematics.py +++ b/src/adam/casadi/inverse_kinematics.py @@ -582,13 +582,13 @@ def _check_target_type(self, frame: str, expected: TargetType): def add_cost(self, cost: cs.MX): """Add a custom cost term to the optimization problem. - This method appends the provided cost term to the `cost_terms` list. - During the `_finalize_problem` step, all cost terms in this list are - combined using `cs.sum(cs.vertcat(*self.cost_terms))` and minimized + This method appends the provided cost term to the `cost_terms` list. + During the `_finalize_problem` step, all cost terms in this list are + combined using `cs.sum(cs.vertcat(*self.cost_terms))` and minimized as part of the objective function. - Note: This method ensures that the optimization graph is still modifiable - before adding the cost term. Once the problem is finalized (after the + Note: This method ensures that the optimization graph is still modifiable + before adding the cost term. Once the problem is finalized (after the first call to `solve()`), no new cost terms can be added. Args: cost (cs.MX): The cost term to add. From 70fde9c496bdb8bef3a4d95e24d0a908b90b88c6 Mon Sep 17 00:00:00 2001 From: Giuseppe L'Erario Date: Tue, 2 Sep 2025 16:01:05 +0000 Subject: [PATCH 6/6] Update max jax version --- ci_env.yml | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci_env.yml b/ci_env.yml index c75bcd41..70f0976d 100644 --- a/ci_env.yml +++ b/ci_env.yml @@ -16,7 +16,7 @@ dependencies: - pytest-repeat - icub-models - idyntree >=11.0.0 - - jax==0.6.0 + - jax<=0.6.0 - pytorch - jax2torch - requests diff --git a/pyproject.toml b/pyproject.toml index 37fe3d62..fe8f4c25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,11 +34,11 @@ dependencies = [ ] [project.optional-dependencies] -jax = ["jax==0.6.0", "jaxlib"] +jax = ["jax<=0.6.0", "jaxlib"] casadi = ["casadi"] pytorch = ["torch", "jax", "jaxlib", "jax2torch"] test = [ - "jax==0.6.0", + "jax<=0.6.0", "jaxlib", "casadi", "torch",