From 48e5b6428f2ec7710726e03f492864e4e2321e07 Mon Sep 17 00:00:00 2001 From: Ipuch Date: Fri, 22 Apr 2022 16:42:31 -0400 Subject: [PATCH] Auto stash before revert of "root_dynamics as an implicit constraint available in bioptim" one more fix on checking if it is biorbd_casadi or biorbd --- bioptim/optimization/optimal_control_program.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bioptim/optimization/optimal_control_program.py b/bioptim/optimization/optimal_control_program.py index caa4da6ec..a94d7d2e9 100644 --- a/bioptim/optimization/optimal_control_program.py +++ b/bioptim/optimization/optimal_control_program.py @@ -954,8 +954,9 @@ def load(file_path: str) -> list: data = pickle.load(file) ocp = OptimalControlProgram(**data["ocp_initializer"]) for key in data["versions"].keys(): + key_module = "biorbd_casadi" if key == "biorbd" else key try: - check_version(sys.modules[key], data["versions"][key], ocp.version[key], exclude_max=False) + check_version(sys.modules[key_module], data["versions"][key], ocp.version[key], exclude_max=False) except ImportError: raise ImportError( f"Version of {key} from file ({data['versions'][key]}) is not the same as the "