eflips-depot 4.2.1__py3-none-any.whl → 4.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -493,6 +493,8 @@ def apply_even_smart_charging(
493
493
 
494
494
  :return: None. The results are added to the database.
495
495
  """
496
+ logger = logging.getLogger(__name__)
497
+
496
498
  with create_session(scenario, database_url) as (session, scenario):
497
499
  depots = session.query(Depot).filter(Depot.scenario_id == scenario.id).all()
498
500
  for depot in depots:
@@ -521,7 +523,7 @@ def apply_even_smart_charging(
521
523
  next_event is None
522
524
  or next_event.event_type != EventType.STANDBY_DEPARTURE
523
525
  ):
524
- warnings.warn(
526
+ logger.info(
525
527
  f"Event {charging_event.id} has no STANDBY_DEPARTURE event after a CHARGING_DEPOT "
526
528
  f"event. No room for smart charging."
527
529
  )
@@ -1100,6 +1102,8 @@ def _generate_vehicle_events(
1100
1102
  :return: None. The results are added to the dictionary.
1101
1103
  """
1102
1104
 
1105
+ logger = logging.getLogger(__name__)
1106
+
1103
1107
  # For convenience
1104
1108
  area_log = current_vehicle.logger.loggedData["dwd.current_area"]
1105
1109
  slot_log = current_vehicle.logger.loggedData["dwd.current_slot"]
@@ -1119,7 +1123,7 @@ def _generate_vehicle_events(
1119
1123
  if waiting_info["waiting_time"] == 0:
1120
1124
  continue
1121
1125
 
1122
- warnings.warn(
1126
+ logger.info(
1123
1127
  f"Vehicle {current_vehicle.ID} has been waiting for {waiting_info['waiting_time']} seconds. "
1124
1128
  )
1125
1129
 
@@ -1194,7 +1198,7 @@ def _generate_vehicle_events(
1194
1198
  dict_of_events[start_this_event]["type"]
1195
1199
  == "Trip"
1196
1200
  ):
1197
- print(
1201
+ logger.info(
1198
1202
  f"Vehicle {current_vehicle.ID} must depart immediately after charged. "
1199
1203
  f"Thus there will be no STANDBY_DEPARTURE event."
1200
1204
  )
@@ -1456,6 +1460,8 @@ def _update_waiting_events(session, scenario, waiting_area_id) -> None:
1456
1460
 
1457
1461
  :return: None. The results are added to the database.
1458
1462
  """
1463
+ logger = logging.getLogger(__name__)
1464
+
1459
1465
  # Process all the STANDBY (waiting) events #
1460
1466
  all_waiting_starts = (
1461
1467
  session.query(Event)
@@ -1482,7 +1488,7 @@ def _update_waiting_events(session, scenario, waiting_area_id) -> None:
1482
1488
  ), f"Number of waiting events starts {len(all_waiting_starts)} is not equal to the number of waiting event ends"
1483
1489
 
1484
1490
  if len(all_waiting_starts) == 0:
1485
- print(
1491
+ logger.info(
1486
1492
  "No waiting events found. The depot has enough capacity for waiting. Change the waiting area capacity to 10 as buffer."
1487
1493
  )
1488
1494
 
@@ -1513,7 +1519,7 @@ def _update_waiting_events(session, scenario, waiting_area_id) -> None:
1513
1519
  waiting_area_id = all_waiting_starts[0].area_id
1514
1520
  waiting_area = session.query(Area).filter(Area.id == waiting_area_id).first()
1515
1521
  if waiting_area.capacity > peak_waiting_occupancy:
1516
- warnings.warn(
1522
+ logger.info(
1517
1523
  f"Current waiting area capacity {waiting_area.capacity} "
1518
1524
  f"is greater than the peak waiting occupancy. Updating the capacity to {peak_waiting_occupancy}."
1519
1525
  )
@@ -130,11 +130,7 @@ def repeat_vehicle_schedules(
130
130
 
131
131
  for vehicle_schedule in vehicle_schedules:
132
132
  schedule_list_backward.append(vehicle_schedule.repeat(-repetition_period))
133
- if repetition_period == timedelta(days=1):
134
- # For daily schedules, repeat the schedule backward twice for the stability of the results
135
- schedule_list_backward.append(
136
- vehicle_schedule.repeat(-2 * repetition_period)
137
- )
133
+ schedule_list_backward.append(vehicle_schedule.repeat(-2 * repetition_period))
138
134
 
139
135
  schedule_list_forward.append(vehicle_schedule.repeat(repetition_period))
140
136
 
@@ -180,7 +176,9 @@ def start_and_end_times(vehicle_schedules) -> Tuple[datetime, int]:
180
176
 
181
177
  def check_depot_validity(depot: Depot) -> None:
182
178
  """
183
- Check if the depot is valid for the eflips-depot simulation. Raise an AssertionError if it is not.
179
+ Check if the depot is valid for the eflips-depot simulation.
180
+
181
+ Raise an AssertionError if it is not.
184
182
  :param depot: a :class:`eflips.model.Depot` object.
185
183
  :return: None
186
184
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eflips-depot
3
- Version: 4.2.1
3
+ Version: 4.3.0
4
4
  Summary: Depot Simulation for eFLIPS
5
5
  Home-page: https://github.com/mpm-tu-berlin/eflips-depot
6
6
  License: AGPL-3.0-or-later
@@ -1,10 +1,10 @@
1
1
  eflips/depot/__init__.py,sha256=n7jte8R6j_Ad4Mp4hkklKwil5r8u8Q_SbXrCC-nf5jM,1556
2
- eflips/depot/api/__init__.py,sha256=vfaJDCPdhAMfqNb9ik4lpmlz62j9JOrJSM9njAv4PJA,67824
2
+ eflips/depot/api/__init__.py,sha256=gprfIzkDZe7KW1K8GAC3TqNjXZRbMqh0q4aOgc0Uvcc,67956
3
3
  eflips/depot/api/defaults/default_settings.json,sha256=0eUDTw_rtLQFvthP8oJL93iRXlmAOravAg-4qqGMQAY,5375
4
4
  eflips/depot/api/private/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  eflips/depot/api/private/depot.py,sha256=pgLk9rdjZthk35vKCTmcl4VfjYQJRnqR-CPGwBs_9zk,18111
6
6
  eflips/depot/api/private/smart_charging.py,sha256=JqYlUv_TnEqnp1Ks3FV3Od2rkYMOSORfUhrxZ49lUyE,13775
7
- eflips/depot/api/private/util.py,sha256=0l1ZFtMamdapPjk3OXiGCP5STefmN6b-RlfUyMd9PbQ,17017
7
+ eflips/depot/api/private/util.py,sha256=LtDIW904chDby9ERmvbVum5YtOZXi1OmN4a2SszmIfs,16834
8
8
  eflips/depot/configuration.py,sha256=Op3hlir-dEN7yHr0kTqbYANoCBKFWK6uKOv3NJl8w_w,35678
9
9
  eflips/depot/depot.py,sha256=afIlaiX-J-M5-K_oAGMr_soL3_QjIAwrQKDaZzTwle0,105566
10
10
  eflips/depot/evaluation.py,sha256=qqXyP4jA1zFcKuWhliQ6n25ZlGl9mJV-vtXf0yu8WN8,140842
@@ -35,7 +35,7 @@ eflips/depot/simulation.py,sha256=ee0qTzOzG-8ybN36ie_NJallXfC7jUaS9JZvaYFziLs,10
35
35
  eflips/depot/smart_charging.py,sha256=C3BYqzn2-OYY4ipXm0ETtavbAM9QXZMYULBpVoChf0E,54311
36
36
  eflips/depot/standalone.py,sha256=VxcTzBaB67fNJUMmjPRwKXjhqTy6oQ41Coote2LvAmk,22338
37
37
  eflips/depot/validation.py,sha256=TIuY7cQtEJI4H2VVMSuY5IIVkacEEZ67weeMuY3NSAM,7097
38
- eflips_depot-4.2.1.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
39
- eflips_depot-4.2.1.dist-info/METADATA,sha256=py-gD6MYp6_5DbqTkz-9y2JpULWDEmWlKqzdLKeG9Wg,5839
40
- eflips_depot-4.2.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
41
- eflips_depot-4.2.1.dist-info/RECORD,,
38
+ eflips_depot-4.3.0.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
39
+ eflips_depot-4.3.0.dist-info/METADATA,sha256=dQypVYCyV6xQti1cM4rsLTofJ8nJnvQaA95uarxhfr4,5839
40
+ eflips_depot-4.3.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
41
+ eflips_depot-4.3.0.dist-info/RECORD,,