Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cocofest/dynamics/initial_guess_warm_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
This class is meant to determine the initial states and control guesses of an optimization problem.
"""

from __future__ import annotations

import numpy as np

import biorbd
Expand Down
2 changes: 2 additions & 0 deletions cocofest/integration/ivp_fes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Code used to determine the Initial Value Problem.
"""

from __future__ import annotations

import numpy as np
from bioptim import (
ControlType,
Expand Down
2 changes: 2 additions & 0 deletions cocofest/misc/fourier_approx.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
This class enables the creation of a Fourier serie, to track a position, a force position with the optimization problem.
"""

from __future__ import annotations

from casadi import cos, sin
import matplotlib.pyplot as plt
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/ding2003/ding2003.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
during functional electrical stimulation. Journal of Electromyography and Kinesiology, 13(6), 575-588.
"""

from __future__ import annotations

from typing import Callable, List
from math import gcd
from fractions import Fraction
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/ding2003/ding2003_with_fatigue.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
during functional electrical stimulation. Journal of Electromyography and Kinesiology, 13(6), 575-588.
"""

from __future__ import annotations

from typing import Callable

from casadi import MX, vertcat
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/ding2007/ding2007.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
force-intensity and force-frequency relationships after spinal cord injuries. Muscle & Nerve, 36(2), 214-222.
"""

from __future__ import annotations

from typing import Callable, List

from casadi import MX, vertcat, exp
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/ding2007/ding2007_with_fatigue.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
force-intensity and force-frequency relationships after spinal cord injuries. Muscle & Nerve, 36(2), 214-222.
"""

from __future__ import annotations

from typing import Callable

from casadi import MX, vertcat
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/dynamical_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Musculoskeletal model driven by one or more FES muscle models.
"""

from __future__ import annotations

from typing import Callable, List
import numpy as np

Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/fes_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Abstract interface every FES model must implement to be usable within bioptim.
"""

from __future__ import annotations

from abc import ABC, abstractmethod

from casadi import MX
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/hill_coefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Annals of biomedical engineering, 44, 2922-2936.
"""

from __future__ import annotations

from casadi import exp, log, sqrt


Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/hmed2018/hmed2018.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Computers in Biology and Medicine, 101, 218-228.
"""

from __future__ import annotations

from typing import Callable, List

from casadi import MX, vertcat, tanh
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/hmed2018/hmed2018_with_fatigue.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
Computers in Biology and Medicine, 101, 218-228.
"""

from __future__ import annotations

from typing import Callable

from casadi import MX, vertcat
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/marion2009/marion2009.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
muscle length on fatigue during electrical stimulation. Muscle & Nerve, 40(4), 573-581.
"""

from __future__ import annotations

from typing import Callable

from casadi import MX, vertcat
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/marion2009/marion2009_modified.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
muscle length on fatigue during electrical stimulation. Muscle & Nerve, 40(4), 573-581.
"""

from __future__ import annotations

from typing import Callable

from casadi import MX, vertcat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
muscle length on fatigue during electrical stimulation. Muscle & Nerve, 40(4), 573-581.
"""

from __future__ import annotations

from typing import Callable

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/marion2009/marion2009_with_fatigue.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
muscle length on fatigue during electrical stimulation. Muscle & Nerve, 40(4), 573-581.
"""

from __future__ import annotations

from typing import Callable

import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/marion2013/marion2013.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
and Rehabilitation, 10, 1-16.
"""

from __future__ import annotations

from typing import Callable
from casadi import MX, vertcat, exp, cos, pi
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/marion2013/marion2013_modified.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
and Rehabilitation, 10, 1-16.
"""

from __future__ import annotations

from typing import Callable
from casadi import MX, vertcat, exp, cos, pi
import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
and Rehabilitation, 10, 1-16.
"""

from __future__ import annotations

from typing import Callable
from casadi import MX, vertcat
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/marion2013/marion2013_with_fatigue.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
and Rehabilitation, 10, 1-16.
"""

from __future__ import annotations

from typing import Callable
from casadi import MX, vertcat
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/state_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Registers the bioptim states/controls used by Cocofest's FES and musculoskeletal models.
"""

from __future__ import annotations

from bioptim import (
ConfigureVariables,
NonLinearProgram,
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/veltink1992/veltink1992.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
for artificially stimulated muscle. IEEE Transactions on Biomedical Engineering, 39(4), 368-380.
"""

from __future__ import annotations

from typing import Callable, List
from casadi import MX, vertcat
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions cocofest/models/veltink1992/veltink1992_and_riener1998.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
fatigue during electrical stimulation. IEEE Transactions on Biomedical Engineering, 45(1), 105-113.
"""

from __future__ import annotations

from typing import Callable
from casadi import MX, vertcat
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions cocofest/optimization/fes_id_ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Builds the optimal control problem used to identify FES model parameters by fitting a tracked force curve.
"""

from __future__ import annotations

import numpy as np

from bioptim import (
Expand Down
2 changes: 2 additions & 0 deletions cocofest/optimization/fes_mhe.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Moving horizon estimation (MHE) for a single-muscle FES model.
"""

from __future__ import annotations

import numpy as np

from casadi import SX
Expand Down
2 changes: 2 additions & 0 deletions cocofest/optimization/fes_mhe_multibody.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Moving horizon estimation (MHE) for a musculoskeletal model (FesMskModel) driven by FES.
"""

from __future__ import annotations

import numpy as np
from copy import deepcopy
from casadi import SX
Expand Down
2 changes: 2 additions & 0 deletions cocofest/optimization/fes_ocp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Builds the optimal control problem used to optimize a single-muscle FES model.
"""

from __future__ import annotations

import numpy as np

from bioptim import (
Expand Down
2 changes: 2 additions & 0 deletions cocofest/optimization/fes_ocp_multibody.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Builds the optimal control problem for a musculoskeletal model driven by one or more FES muscle models.
"""

from __future__ import annotations

import numpy as np

from bioptim import (
Expand Down
2 changes: 2 additions & 0 deletions cocofest/optimization/penalties/custom_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
By adding definitions to this class, you can create your own custom constraints.
"""

from __future__ import annotations

from casadi import MX, SX, vertcat
from bioptim import PenaltyController

Expand Down
2 changes: 2 additions & 0 deletions cocofest/optimization/penalties/custom_objectives.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
By adding definitions to this class, you can create your own custom objective.
"""

from __future__ import annotations

from casadi import MX, vertcat
from bioptim import PenaltyController
from ...models.fes_model import FesModel
Expand Down
2 changes: 2 additions & 0 deletions cocofest/result/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
model identification.
"""

from __future__ import annotations

from bioptim import Solution, SolutionMerge, InterpolationType
import matplotlib.pyplot as plt
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions cocofest/result/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Exports a bioptim Solution's time, states, controls and parameters to a pickle file for later reuse.
"""

from __future__ import annotations

import pickle
import numpy as np
from bioptim import SolutionMerge
Expand Down
2 changes: 2 additions & 0 deletions cocofest/result/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Plots the muscle stimulation angle and related quantities of a cycling motion.
"""

from __future__ import annotations

import numpy as np
import matplotlib

Expand Down
15 changes: 10 additions & 5 deletions docs/sphinx/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import importlib.util
import pathlib
import sys

sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent.parent.parent))
repo_root = pathlib.Path(__file__).resolve().parent.parent.parent
sys.path.insert(0, str(repo_root))

from cocofest.misc.__version__ import __version__ as release
_version_spec = importlib.util.spec_from_file_location(
"cocofest_version", repo_root / "cocofest" / "misc" / "__version__.py"
)
_version_module = importlib.util.module_from_spec(_version_spec)
_version_spec.loader.exec_module(_version_module)
release = _version_module.__version__

project = "Cocofest"
author = "Kev1Co"
Expand All @@ -27,9 +34,7 @@
".md": "markdown",
}

# cocofest.result.animate is not needed to build the docs and depends on
# pyorerun, which is not installed in the docs environment.
autodoc_mock_imports = ["pyorerun"]
autodoc_mock_imports = ["bioptim", "biorbd", "casadi", "pyorerun"]

autosummary_generate = True
autodoc_default_options = {"undoc-members": True}
Expand Down
1 change: 0 additions & 1 deletion docs/sphinx/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ channels:
- conda-forge
dependencies:
- python=3.11
- bioptim=3.4.0
Loading