diff --git a/code/requirements.txt b/code/requirements.txt index 1f0d079..2e68a3d 100644 --- a/code/requirements.txt +++ b/code/requirements.txt @@ -5,4 +5,5 @@ scipy numpy jax numba -pygame \ No newline at end of file +pygame +matplotlib \ No newline at end of file diff --git a/code/simulator/Cases.py b/code/simulator/Cases.py index 92c1dc8..b56edbc 100644 --- a/code/simulator/Cases.py +++ b/code/simulator/Cases.py @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ @@ -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 """ diff --git a/code/simulator/IndexedElement.py b/code/simulator/IndexedElement.py index a230a0f..1c7dc85 100644 --- a/code/simulator/IndexedElement.py +++ b/code/simulator/IndexedElement.py @@ -1,6 +1,6 @@ -class IndexedElement: +class IndexedElement: # pylint: disable=too-few-public-methods index: int def setIndex(self, index: int) -> None: diff --git a/code/simulator/Simulation.py b/code/simulator/Simulation.py index 3459e73..1bd0779 100644 --- a/code/simulator/Simulation.py +++ b/code/simulator/Simulation.py @@ -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 diff --git a/code/simulator/SimulationFunctions.py b/code/simulator/SimulationFunctions.py index 092edcd..c878c94 100644 --- a/code/simulator/SimulationFunctions.py +++ b/code/simulator/SimulationFunctions.py @@ -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) """