Skip to content

Commit 7a0081d

Browse files
authored
removed type-hints from self-parameter
1 parent 3093f52 commit 7a0081d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

physics/n_body_simulation.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
class Body:
2424
def __init__(
25-
self: Body,
25+
self,
2626
position_x: float,
2727
position_y: float,
2828
velocity_x: float,
@@ -44,7 +44,7 @@ def __init__(
4444
self.color = color
4545

4646
def update_velocity(
47-
self: Body, force_x: float, force_y: float, delta_time: float
47+
self, force_x: float, force_y: float, delta_time: float
4848
) -> None:
4949
"""
5050
Euler algorithm for velocity
@@ -71,7 +71,7 @@ def update_velocity(
7171
self.velocity_x += force_x * delta_time
7272
self.velocity_y += force_y * delta_time
7373

74-
def update_position(self: Body, delta_time: float) -> None:
74+
def update_position(self, delta_time: float) -> None:
7575
"""
7676
Euler algorithm for position
7777
@@ -107,7 +107,7 @@ class BodySystem:
107107
"""
108108

109109
def __init__(
110-
self: BodySystem,
110+
self,
111111
bodies: list[Body],
112112
gravitation_constant: float = 1.0,
113113
time_factor: float = 1.0,
@@ -118,7 +118,7 @@ def __init__(
118118
self.time_factor = time_factor
119119
self.softening_factor = softening_factor
120120

121-
def update_system(self: BodySystem, delta_time: float) -> None:
121+
def update_system(self, delta_time: float) -> None:
122122
"""
123123
For each body, loop through all other bodies to calculate the total
124124
force they exert on it. Use that force to update the body's velocity.

0 commit comments

Comments
 (0)