Skip to content

Commit

Permalink
Fix flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Marvin Kastner committed May 26, 2024
1 parent a44c648 commit c762a1a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
6 changes: 4 additions & 2 deletions conflowgen/api/port_call_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def add_service_that_calls_terminal(
.. math::
min(
\text{average_inbound_container_volume} \cdot \text{transportation_buffer},\text{average_vehicle_capacity}
\text{average_inbound_container_volume} \cdot \text{transportation_buffer},
\text{average_vehicle_capacity}
)
If you have calibrated the aforementioned distribution accordingly, the actual number of containers on
Expand Down Expand Up @@ -152,7 +153,8 @@ def add_vehicle(
.. math::
min(
\text{average_inbound_container_volume} \cdot \text{transportation_buffer},\text{average_vehicle_capacity}
\text{average_inbound_container_volume} \cdot \text{transportation_buffer},
\text{average_vehicle_capacity}
)
If you have calibrated the aforementioned distribution accordingly, the actual number of containers on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@ def get_outbound_capacity_of_vehicles(start_date, end_date, transportation_buffe

schedule: Schedule
for schedule in Schedule.select():
assert (
schedule.average_inbound_container_volume <= schedule.average_vehicle_capacity,
"A vehicle cannot move a larger amount of containers (in TEU) than its capacity, "
f"the input data is malformed. Schedule '{schedule.service_name}' of vehicle type "
f"{schedule.vehicle_type} has an average moved capacity of {schedule.average_inbound_container_volume} "
f"but an averaged vehicle capacity of {schedule.average_vehicle_capacity}."
)
assert \
schedule.average_inbound_container_volume <= schedule.average_vehicle_capacity, \
(
"A vehicle cannot move a larger amount of containers (in TEU) than its capacity, "
f"the input data is malformed. Schedule '{schedule.service_name}' of vehicle type "
f"{schedule.vehicle_type} has an average moved capacity of "
f"{schedule.average_inbound_container_volume} but an averaged vehicle capacity of "
f"{schedule.average_vehicle_capacity}."
)

arrivals = create_arrivals_within_time_range(
start_date,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ def _get_number_containers_for_outbound_journey(
).count()
return number_loaded_containers


@classmethod
def _get_number_containers_for_inbound_journey(
cls,
Expand Down
3 changes: 2 additions & 1 deletion conflowgen/domain_models/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class LargeScheduledVehicle(BaseModel):
)
inbound_container_volume = IntegerField(
null=False,
help_text="This is the actually moved container volume in TEU for a single terminal visit on the inbound journey."
help_text="This is the actually moved container volume in TEU for a single terminal visit on the inbound "
"journey."
)
scheduled_arrival = DateTimeField(
null=False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def test_free_capacity_on_outbound_journey_without_any_containers_and_no_ramp_up
)
self.assertEqual(free_capacity_on_feeder, 600)


@parameterized.parameterized.expand([
[FlowDirection.import_flow, 30, 600],
[FlowDirection.export_flow, 30, 600],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def test_get_maximum_transported_container_volume_on_outbound_journey_and_no_ram
scaled_moved_container_volume, unscaled_moved_container_volume = deep_sea_vessel_calc
self.assertEqual(scaled_moved_container_volume, 3000)


@parameterized.parameterized.expand([
[FlowDirection.import_flow, 600, 3000], # normal values
[FlowDirection.export_flow, 600, 3000], # normal values
Expand Down Expand Up @@ -138,7 +137,6 @@ def test_get_maximum_transported_container_volume_on_outbound_journey_and_a_non_
scaled_moved_container_volume, unscaled_moved_container_volume = deep_sea_volume_calc
self.assertEqual(scaled_moved_container_volume, deep_sea_volume)


def test_get_transported_container_volume_on_inbound_journey_and_no_ramp_down_period(self):
"""
Independent of the flow direction, the inbound capacity should not change as long as no ramp-down period is
Expand Down

0 comments on commit c762a1a

Please sign in to comment.