eflips-depot 4.3.2__py3-none-any.whl → 4.3.4__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.

Potentially problematic release.


This version of eflips-depot might be problematic. Click here for more details.

@@ -492,6 +492,8 @@ def apply_even_smart_charging(
492
492
 
493
493
  :return: None. The results are added to the database.
494
494
  """
495
+ logger = logging.getLogger(__name__)
496
+
495
497
  with create_session(scenario, database_url) as (session, scenario):
496
498
  depots = session.query(Depot).filter(Depot.scenario_id == scenario.id).all()
497
499
  for depot in depots:
@@ -520,7 +522,7 @@ def apply_even_smart_charging(
520
522
  next_event is None
521
523
  or next_event.event_type != EventType.STANDBY_DEPARTURE
522
524
  ):
523
- warnings.warn(
525
+ logger.info(
524
526
  f"Event {charging_event.id} has no STANDBY_DEPARTURE event after a CHARGING_DEPOT "
525
527
  f"event. No room for smart charging."
526
528
  )
@@ -1099,6 +1101,8 @@ def _generate_vehicle_events(
1099
1101
  :return: None. The results are added to the dictionary.
1100
1102
  """
1101
1103
 
1104
+ logger = logging.getLogger(__name__)
1105
+
1102
1106
  # For convenience
1103
1107
  area_log = current_vehicle.logger.loggedData["dwd.current_area"]
1104
1108
  slot_log = current_vehicle.logger.loggedData["dwd.current_slot"]
@@ -1118,7 +1122,7 @@ def _generate_vehicle_events(
1118
1122
  if waiting_info["waiting_time"] == 0:
1119
1123
  continue
1120
1124
 
1121
- warnings.warn(
1125
+ logger.info(
1122
1126
  f"Vehicle {current_vehicle.ID} has been waiting for {waiting_info['waiting_time']} seconds. "
1123
1127
  )
1124
1128
 
@@ -1188,6 +1192,24 @@ def _generate_vehicle_events(
1188
1192
  and "end" in dict_of_events[time_stamp].keys()
1189
1193
  ):
1190
1194
  start_this_event = dict_of_events[time_stamp]["end"]
1195
+ if start_this_event in dict_of_events.keys():
1196
+ if (
1197
+ dict_of_events[start_this_event]["type"]
1198
+ == "Trip"
1199
+ ):
1200
+ logger.info(
1201
+ f"Vehicle {current_vehicle.ID} must depart immediately after charged. "
1202
+ f"Thus there will be no STANDBY_DEPARTURE event."
1203
+ )
1204
+
1205
+ else:
1206
+ raise ValueError(
1207
+ f"There is already an event "
1208
+ f"{dict_of_events[start_this_event]} at {start_this_event}."
1209
+ )
1210
+
1211
+ continue
1212
+
1191
1213
  dict_of_events[start_this_event] = {
1192
1214
  "type": type(process).__name__,
1193
1215
  "area": current_area.ID,
@@ -1437,6 +1459,8 @@ def _update_waiting_events(session, scenario, waiting_area_id) -> None:
1437
1459
 
1438
1460
  :return: None. The results are added to the database.
1439
1461
  """
1462
+ logger = logging.getLogger(__name__)
1463
+
1440
1464
  # Process all the STANDBY (waiting) events #
1441
1465
  all_waiting_starts = (
1442
1466
  session.query(Event)
@@ -1463,7 +1487,7 @@ def _update_waiting_events(session, scenario, waiting_area_id) -> None:
1463
1487
  ), f"Number of waiting events starts {len(all_waiting_starts)} is not equal to the number of waiting event ends"
1464
1488
 
1465
1489
  if len(all_waiting_starts) == 0:
1466
- print(
1490
+ logger.info(
1467
1491
  "No waiting events found. The depot has enough capacity for waiting. Change the waiting area capacity to 10 as buffer."
1468
1492
  )
1469
1493
 
@@ -1494,7 +1518,7 @@ def _update_waiting_events(session, scenario, waiting_area_id) -> None:
1494
1518
  waiting_area_id = all_waiting_starts[0].area_id
1495
1519
  waiting_area = session.query(Area).filter(Area.id == waiting_area_id).first()
1496
1520
  if waiting_area.capacity > peak_waiting_occupancy:
1497
- warnings.warn(
1521
+ logger.info(
1498
1522
  f"Current waiting area capacity {waiting_area.capacity} "
1499
1523
  f"is greater than the peak waiting occupancy. Updating the capacity to {peak_waiting_occupancy}."
1500
1524
  )
@@ -321,7 +321,7 @@ def create_simple_depot(
321
321
  scenario=scenario,
322
322
  name=f"Depot at {station.name}",
323
323
  name_short=station.name_short,
324
- station=station,
324
+ station_id=station.id,
325
325
  )
326
326
  session.add(depot)
327
327
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: eflips-depot
3
- Version: 4.3.2
3
+ Version: 4.3.4
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,8 +1,8 @@
1
1
  eflips/depot/__init__.py,sha256=n7jte8R6j_Ad4Mp4hkklKwil5r8u8Q_SbXrCC-nf5jM,1556
2
- eflips/depot/api/__init__.py,sha256=iAGL9CPL2pjs0ol3VW0jCokvYa-OZqnwdjfq07wpMvw,66734
2
+ eflips/depot/api/__init__.py,sha256=bYgszgeN7Kv9eam1he3lKGLqkd7VwHtb7FDPC-slLEY,67883
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
- eflips/depot/api/private/depot.py,sha256=pgLk9rdjZthk35vKCTmcl4VfjYQJRnqR-CPGwBs_9zk,18111
5
+ eflips/depot/api/private/depot.py,sha256=oPFjB8YLQhqfvs3PxHRIYqpmCjTbcvNYlyhE51cqgZw,18117
6
6
  eflips/depot/api/private/smart_charging.py,sha256=Wne-C9zl-5hSidM4xxlfQ48R_s08zbomv4cY2qvJjSQ,13887
7
7
  eflips/depot/api/private/util.py,sha256=LtDIW904chDby9ERmvbVum5YtOZXi1OmN4a2SszmIfs,16834
8
8
  eflips/depot/configuration.py,sha256=Op3hlir-dEN7yHr0kTqbYANoCBKFWK6uKOv3NJl8w_w,35678
@@ -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.3.2.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
39
- eflips_depot-4.3.2.dist-info/METADATA,sha256=vVy3PWP5czjwtyD1clOL5LPd2NAR3zX_8nO9pcMVjpE,5839
40
- eflips_depot-4.3.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
41
- eflips_depot-4.3.2.dist-info/RECORD,,
38
+ eflips_depot-4.3.4.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
39
+ eflips_depot-4.3.4.dist-info/METADATA,sha256=mLpay-L-48axrzYy3mB-iTZueU4eD4AhAaCKc5mhqAo,5839
40
+ eflips_depot-4.3.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
41
+ eflips_depot-4.3.4.dist-info/RECORD,,