Skip to content

Commit 9828421

Browse files
committed
Address rabbitai review
1 parent ebe412c commit 9828421

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

pooltool/physics/resolve/ball_ball/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ def resolve_continually_touching(
204204

205205
# Chased ball steals fraction of chaser's line of centers momentum
206206
# FIXME: We assume equal mass, so transfer velocity directly
207-
theft_fraction = theft_fraction
208207
stolen_loc_velocity = chaser_loc_vel * theft_fraction
209208

210209
if ball1_is_chaser:

pooltool/physics/resolve/transition/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from pooltool.objects.ball.datatypes import Ball
1616
from pooltool.physics.resolve.models import BallTransitionModel
1717

18-
TOLERANCE = 1e-12
18+
_TOLERANCE = 1e-12
1919

2020

2121
class BallTransitionStrategy(Protocol):
@@ -49,8 +49,8 @@ def resolve(self, ball: Ball, transition: EventType, inplace: bool = False) -> B
4949
# angular velocity components are nearly 0. Then set them to exactly 0.
5050
v = ball.state.rvw[1]
5151
w = ball.state.rvw[2]
52-
assert (np.abs(v) < TOLERANCE).all()
53-
assert (np.abs(w[:2]) < TOLERANCE).all()
52+
assert (np.abs(v) < _TOLERANCE).all()
53+
assert (np.abs(w[:2]) < _TOLERANCE).all()
5454

5555
ball.state.rvw[1, :] = [0.0, 0.0, 0.0]
5656
ball.state.rvw[2, :2] = [0.0, 0.0]
@@ -60,8 +60,8 @@ def resolve(self, ball: Ball, transition: EventType, inplace: bool = False) -> B
6060
# set them to exactly 0.
6161
v = ball.state.rvw[1]
6262
w = ball.state.rvw[2]
63-
assert (np.abs(v) < TOLERANCE).all()
64-
assert (np.abs(w) < TOLERANCE).all()
63+
assert (np.abs(v) < _TOLERANCE).all()
64+
assert (np.abs(w) < _TOLERANCE).all()
6565

6666
ball.state.rvw[1, :] = [0.0, 0.0, 0.0]
6767
ball.state.rvw[2, :] = [0.0, 0.0, 0.0]

tests/evolution/event_based/test_simulate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def true_time_to_collision(eps, V0, mu_r, g):
407407

408408

409409
def test_ball_ball_collision_for_intersecting_balls():
410-
"""Two already intersecting balls don't collide.
410+
"""Two already intersecting balls collide.
411411
412412
Previously, intersecting balls were prevented from colliding to avoid perpetual
413413
internal collisions. Now, with the improved make_kiss implementation, intersecting

0 commit comments

Comments
 (0)