Skip to content

Commit

Permalink
Update requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmanuelMess committed Aug 8, 2024
1 parent fff2675 commit 42eeb61
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion code/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ scipy
numpy
jax
numba
pygame
pygame
matplotlib
15 changes: 15 additions & 0 deletions code/simulator/Cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@


def case1() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Circle constrant single particle
"""
Expand All @@ -29,6 +30,7 @@ def force(_: np.float64) -> np.ndarray:


def case_dot_single_particle() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Circle constrant single particle
"""
Expand All @@ -47,6 +49,7 @@ def force(_: np.float64) -> np.ndarray:


def case_pendulum() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Pendulum under gravity
"""
Expand All @@ -66,6 +69,7 @@ def force(_: np.float64) -> np.ndarray:


def case_double_pendulum() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Double pendulum under gravity
"""
Expand All @@ -87,6 +91,7 @@ def force(_: np.float64) -> np.ndarray:


def case2() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Distance constraint single particle
"""
Expand All @@ -109,6 +114,7 @@ def force(_: np.float64) -> np.ndarray:


def case3() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Circle and distance constraints multi particles
"""
Expand All @@ -129,6 +135,7 @@ def force(_: np.float64) -> np.ndarray:


def case4() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Distance constraints multi particles
"""
Expand Down Expand Up @@ -163,6 +170,7 @@ def force(_: np.float64) -> np.ndarray:


def case5() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Distance constraints multi particles
"""
Expand Down Expand Up @@ -197,6 +205,7 @@ def force(_: np.float64) -> np.ndarray:


def case_hanging_bridge() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Distance constraints multi particles
"""
Expand Down Expand Up @@ -233,6 +242,7 @@ def force(_: np.float64) -> np.ndarray:


def case6() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Circle constrant single particle
"""
Expand All @@ -250,6 +260,7 @@ def force(_: np.float64) -> np.ndarray:


def case7() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Distance constraints in a grid for a lot of particles
"""
Expand Down Expand Up @@ -287,6 +298,7 @@ def force(_: np.float64) -> np.ndarray:


def case8() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Distance constraints in a grid for a lot of particles
"""
Expand Down Expand Up @@ -330,6 +342,7 @@ def force(t: np.float64) -> np.ndarray:


def case9() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Circle constrants single particle
"""
Expand All @@ -347,6 +360,7 @@ def force(_: np.float64) -> np.ndarray:


def case10() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]:
# pylint: disable=too-many-locals
"""
Distance constraints in a grid for a lot of particles
"""
Expand Down Expand Up @@ -384,6 +398,7 @@ def force(_: np.float64) -> np.ndarray:


def torque() -> Tuple[List[Particle], List[Constraint], Callable[[np.float64], np.ndarray]]: # noqa: C901
# pylint: disable=too-many-locals
"""
Distance constraints in a grid for a lot of particles
"""
Expand Down
2 changes: 1 addition & 1 deletion code/simulator/IndexedElement.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


class IndexedElement:
class IndexedElement: # pylint: disable=too-few-public-methods
index: int

def setIndex(self, index: int) -> None:
Expand Down
2 changes: 1 addition & 1 deletion code/simulator/Simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def acceleration(x, v) -> np.ndarray:

grapher.draw(acceleration, self.constraints, self.particles)

def update(self, timestep: np.float64) -> None:
def update(self, timestep: np.float64) -> None: # pylint: disable=too-many-locals
"""
Run internal simulation update.
:param timestep: Delta time at which the *next* step will be shown
Expand Down
2 changes: 1 addition & 1 deletion code/simulator/SimulationFunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class SimulationFunctions:
def precompiledMinimizeAndForceCalculation(ks: np.float64, kd: np.float64, dq: np.ndarray, Q: np.ndarray,
C: np.ndarray, dC: np.ndarray, W: np.ndarray, J: np.ndarray,
dJ: np.ndarray) \
-> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
-> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]: # pylint: disable=too-many-arguments
"""
Resulting force for the particles (see mathematical model)
"""
Expand Down

0 comments on commit 42eeb61

Please sign in to comment.