Skip to content

Commit

Permalink
[pre-commit.ci lite] apply automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci-lite[bot] authored Oct 2, 2023
1 parent 74de619 commit f69614a
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 14 deletions.
8 changes: 6 additions & 2 deletions src/software/ai/hl/stp/play/ball_placement_play_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ def setup(run_enemy_ai):
tbots_cpp.Point(1, 2.5),
tbots_cpp.Point(1, -2.5),
tbots_cpp.Field.createSSLDivisionBField().enemyGoalCenter(),
tbots_cpp.Field.createSSLDivisionBField().enemyDefenseArea().negXNegYCorner(),
tbots_cpp.Field.createSSLDivisionBField().enemyDefenseArea().negXPosYCorner(),
tbots_cpp.Field.createSSLDivisionBField()
.enemyDefenseArea()
.negXNegYCorner(),
tbots_cpp.Field.createSSLDivisionBField()
.enemyDefenseArea()
.negXPosYCorner(),
]

# Game Controller Setup
Expand Down
8 changes: 6 additions & 2 deletions src/software/ai/hl/stp/play/enemy_ball_placement_play_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ def setup(*args):
tbots_cpp.Point(1, 2.5),
tbots_cpp.Point(1, -2.5),
tbots_cpp.Field.createSSLDivisionBField().enemyGoalCenter(),
tbots_cpp.Field.createSSLDivisionBField().enemyDefenseArea().negXNegYCorner(),
tbots_cpp.Field.createSSLDivisionBField().enemyDefenseArea().negXPosYCorner(),
tbots_cpp.Field.createSSLDivisionBField()
.enemyDefenseArea()
.negXNegYCorner(),
tbots_cpp.Field.createSSLDivisionBField()
.enemyDefenseArea()
.negXPosYCorner(),
]

# Game Controller Setup
Expand Down
12 changes: 10 additions & 2 deletions src/software/ai/hl/stp/play/free_kick_play_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ def free_kick_play_setup(
# We want to test friendly half, enemy half, and at the border of the field
@pytest.mark.parametrize(
"ball_initial_pos",
[tbots_cpp.Point(1.5, -2.75), tbots_cpp.Point(-1.5, -2.75), tbots_cpp.Point(1.5, -3)],
[
tbots_cpp.Point(1.5, -2.75),
tbots_cpp.Point(-1.5, -2.75),
tbots_cpp.Point(1.5, -3),
],
)
def test_free_kick_play_friendly(simulated_test_runner, ball_initial_pos):
# TODO- #2753 Validation
Expand Down Expand Up @@ -183,7 +187,11 @@ def test_free_kick_play_enemy(simulated_test_runner, ball_initial_pos, yellow_bo

@pytest.mark.parametrize(
"ball_initial_pos",
[tbots_cpp.Point(1.5, -2.75), tbots_cpp.Point(-1.5, -2.75), tbots_cpp.Point(1.5, -3)],
[
tbots_cpp.Point(1.5, -2.75),
tbots_cpp.Point(-1.5, -2.75),
tbots_cpp.Point(1.5, -3),
],
)
def test_free_kick_play_both(simulated_test_runner, ball_initial_pos):
# TODO- #2753 Validation
Expand Down
8 changes: 6 additions & 2 deletions src/software/ai/hl/stp/play/halt_play_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ def setup(*args):
tbots_cpp.Point(1, 2.5),
tbots_cpp.Point(1, -2.5),
tbots_cpp.Field.createSSLDivisionBField().enemyGoalCenter(),
tbots_cpp.Field.createSSLDivisionBField().enemyDefenseArea().negXNegYCorner(),
tbots_cpp.Field.createSSLDivisionBField().enemyDefenseArea().negXPosYCorner(),
tbots_cpp.Field.createSSLDivisionBField()
.enemyDefenseArea()
.negXNegYCorner(),
tbots_cpp.Field.createSSLDivisionBField()
.enemyDefenseArea()
.negXPosYCorner(),
]

# Game Controller Setup
Expand Down
8 changes: 6 additions & 2 deletions src/software/ai/hl/stp/play/kickoff_play_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ def setup(*args):
tbots_cpp.Point(1, 2.5),
tbots_cpp.Point(1, -2.5),
tbots_cpp.Field.createSSLDivisionBField().enemyGoalCenter(),
tbots_cpp.Field.createSSLDivisionBField().enemyDefenseArea().negXNegYCorner(),
tbots_cpp.Field.createSSLDivisionBField().enemyDefenseArea().negXPosYCorner(),
tbots_cpp.Field.createSSLDivisionBField()
.enemyDefenseArea()
.negXNegYCorner(),
tbots_cpp.Field.createSSLDivisionBField()
.enemyDefenseArea()
.negXPosYCorner(),
]

blue_play = Play()
Expand Down
4 changes: 3 additions & 1 deletion src/software/ai/hl/stp/tactic/goalie/goalie_tactic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ def test_goalie_blocks_shot(
[
# Goalie should be in the defense area
RobotEventuallyEntersRegion(
regions=[tbots_cpp.Field.createSSLDivisionBField().friendlyDefenseArea()]
regions=[
tbots_cpp.Field.createSSLDivisionBField().friendlyDefenseArea()
]
),
]
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
# Intercept pass angled away from defender
(tbots_cpp.Point(2, 0), tbots_cpp.Vector(-3, 0), tbots_cpp.Point(-2, 0.5)),
# Intercept diagonal pass
(tbots_cpp.Point(-1, -3), tbots_cpp.Vector(-2, 1.5), tbots_cpp.Point(-3, -0.75)),
(
tbots_cpp.Point(-1, -3),
tbots_cpp.Vector(-2, 1.5),
tbots_cpp.Point(-3, -0.75),
),
],
)
def test_ball_chipped_on_intercept(
Expand Down Expand Up @@ -65,7 +69,9 @@ def test_ball_chipped_on_intercept(
always_validation_sequence_set = [
[
RobotNeverEntersRegion(
regions=[tbots_cpp.Field.createSSLDivisionBField().friendlyDefenseArea()]
regions=[
tbots_cpp.Field.createSSLDivisionBField().friendlyDefenseArea()
]
),
# Defender should intercept ball and prevent it from entering the goal
BallNeverEntersRegion(
Expand Down
4 changes: 3 additions & 1 deletion src/software/simulated_tests/ball_stops_in_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def get_validation_status(self, world) -> ValidationStatus:
if tbots_cpp.contains(
region, tbots_cpp.createPoint(world.ball.current_state.global_position)
) and (
tbots_cpp.createVector(world.ball.current_state.global_velocity).length()
tbots_cpp.createVector(
world.ball.current_state.global_velocity
).length()
<= 0.01
):
return ValidationStatus.PASSING
Expand Down

0 comments on commit f69614a

Please sign in to comment.