Skip to content

Commit fc10614

Browse files
make lint
1 parent 25651de commit fc10614

2 files changed

Lines changed: 18 additions & 18 deletions

File tree

tests/fixtures/controller/controller_fixtures.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,24 +65,24 @@ def controller_function( # pylint: disable=unused-argument
6565
environment,
6666
):
6767
# state = [x, y, z, vx, vy, vz, e0, e1, e2, e3, wx, wy, wz]
68-
altitude_ASL = state[2] # altitude above sea level
69-
altitude_AGL = (
70-
altitude_ASL - environment.elevation
68+
altitude_asl = state[2] # altitude above sea level
69+
altitude_agl = (
70+
altitude_asl - environment.elevation
7171
) # altitude above ground level
7272
vx, vy, vz = state[3], state[4], state[5]
7373

7474
# Use environment parameter instead of global variable
75-
wind_x = environment.wind_velocity_x(altitude_ASL)
76-
wind_y = environment.wind_velocity_y(altitude_ASL)
75+
wind_x = environment.wind_velocity_x(altitude_asl)
76+
wind_y = environment.wind_velocity_y(altitude_asl)
7777

7878
# Calculate Mach number using environment data
7979
free_stream_speed = ((wind_x - vx) ** 2 + (wind_y - vy) ** 2 + (vz) ** 2) ** 0.5
80-
mach_number = free_stream_speed / environment.speed_of_sound(altitude_ASL)
80+
mach_number = free_stream_speed / environment.speed_of_sound(altitude_asl)
8181

8282
if time < 3.9:
8383
return None
8484

85-
if altitude_AGL < 1500:
85+
if altitude_agl < 1500:
8686
air_brakes.deployment_level = 0
8787
else:
8888
previous_vz = state_history[-1][5] if state_history else vz

tests/integration/simulation/test_flight.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def test_7_parameter_controller_with_sensors(calisto_robust, example_plain_env):
604604
"""
605605

606606
# Define a 7-parameter controller
607-
def controller_7_params(
607+
def controller_7_params( # pylint: disable=unused-argument
608608
time,
609609
sampling_rate,
610610
state,
@@ -662,14 +662,14 @@ def test_invalid_controller_parameter_count(calisto_robust):
662662
"""
663663

664664
# Define controller with wrong number of parameters (5)
665-
def invalid_controller_5_params(
665+
def invalid_controller_5_params( # pylint: disable=unused-argument
666666
time, sampling_rate, state, state_history, observed_variables
667667
):
668668
"""Invalid controller with only 5 parameters."""
669669
return None
670670

671671
# Define controller with wrong number of parameters (9)
672-
def invalid_controller_9_params(
672+
def invalid_controller_9_params( # pylint: disable=unused-argument
673673
time,
674674
sampling_rate,
675675
state,
@@ -729,7 +729,7 @@ def test_environment_methods_accessible_in_controller(
729729
"temperature": False,
730730
}
731731

732-
def controller_test_environment_access(
732+
def controller_test_environment_access( # pylint: disable=unused-argument
733733
time,
734734
sampling_rate,
735735
state,
@@ -740,7 +740,7 @@ def controller_test_environment_access(
740740
environment,
741741
):
742742
"""Controller that tests access to various environment methods."""
743-
altitude_ASL = state[2]
743+
altitude_asl = state[2]
744744

745745
if time < 3.9:
746746
return None
@@ -750,25 +750,25 @@ def controller_test_environment_access(
750750
_ = environment.elevation
751751
methods_called["elevation"] = True
752752

753-
_ = environment.wind_velocity_x(altitude_ASL)
753+
_ = environment.wind_velocity_x(altitude_asl)
754754
methods_called["wind_velocity_x"] = True
755755

756-
_ = environment.wind_velocity_y(altitude_ASL)
756+
_ = environment.wind_velocity_y(altitude_asl)
757757
methods_called["wind_velocity_y"] = True
758758

759-
_ = environment.speed_of_sound(altitude_ASL)
759+
_ = environment.speed_of_sound(altitude_asl)
760760
methods_called["speed_of_sound"] = True
761761

762-
_ = environment.pressure(altitude_ASL)
762+
_ = environment.pressure(altitude_asl)
763763
methods_called["pressure"] = True
764764

765-
_ = environment.temperature(altitude_ASL)
765+
_ = environment.temperature(altitude_asl)
766766
methods_called["temperature"] = True
767767

768768
air_brakes.deployment_level = 0.3
769769
except AttributeError as e:
770770
# If any method is not accessible, the test should fail
771-
raise AssertionError(f"Environment method not accessible: {e}")
771+
raise AssertionError(f"Environment method not accessible: {e}") from e
772772

773773
return (time, air_brakes.deployment_level)
774774

0 commit comments

Comments
 (0)