eflips-depot 4.3.1__py3-none-any.whl → 4.3.3__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.
- eflips/depot/api/__init__.py +28 -4
- eflips/depot/api/private/smart_charging.py +7 -4
- {eflips_depot-4.3.1.dist-info → eflips_depot-4.3.3.dist-info}/METADATA +1 -1
- {eflips_depot-4.3.1.dist-info → eflips_depot-4.3.3.dist-info}/RECORD +6 -6
- {eflips_depot-4.3.1.dist-info → eflips_depot-4.3.3.dist-info}/LICENSE.md +0 -0
- {eflips_depot-4.3.1.dist-info → eflips_depot-4.3.3.dist-info}/WHEEL +0 -0
eflips/depot/api/__init__.py
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
)
|
|
@@ -264,10 +264,13 @@ def optimize_charging_events_even(charging_events: List[Event]) -> None:
|
|
|
264
264
|
], # Remove the first and last index
|
|
265
265
|
"soc": socs.tolist()[1:-1],
|
|
266
266
|
}
|
|
267
|
-
if event.timeseries["time"]
|
|
268
|
-
event.timeseries["time"][0]
|
|
269
|
-
|
|
270
|
-
event.timeseries["time"][-1]
|
|
267
|
+
if len(event.timeseries["time"]) > 0:
|
|
268
|
+
if event.timeseries["time"][0] < event.time_start.isoformat():
|
|
269
|
+
event.timeseries["time"][0] = event.time_start.isoformat()
|
|
270
|
+
if event.timeseries["time"][-1] > event.time_end.isoformat():
|
|
271
|
+
event.timeseries["time"][-1] = event.time_end.isoformat()
|
|
272
|
+
else:
|
|
273
|
+
event.timeseries = None
|
|
271
274
|
|
|
272
275
|
# Now we have the power draw and charging allowed for each event
|
|
273
276
|
if False:
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
eflips/depot/__init__.py,sha256=n7jte8R6j_Ad4Mp4hkklKwil5r8u8Q_SbXrCC-nf5jM,1556
|
|
2
|
-
eflips/depot/api/__init__.py,sha256=
|
|
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
5
|
eflips/depot/api/private/depot.py,sha256=pgLk9rdjZthk35vKCTmcl4VfjYQJRnqR-CPGwBs_9zk,18111
|
|
6
|
-
eflips/depot/api/private/smart_charging.py,sha256=
|
|
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
|
|
9
9
|
eflips/depot/depot.py,sha256=afIlaiX-J-M5-K_oAGMr_soL3_QjIAwrQKDaZzTwle0,105566
|
|
@@ -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.
|
|
39
|
-
eflips_depot-4.3.
|
|
40
|
-
eflips_depot-4.3.
|
|
41
|
-
eflips_depot-4.3.
|
|
38
|
+
eflips_depot-4.3.3.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
|
|
39
|
+
eflips_depot-4.3.3.dist-info/METADATA,sha256=21d4OqWRmzRV9An4lpzLhiGMYrdNYZTBrAFDk-7_Ug0,5839
|
|
40
|
+
eflips_depot-4.3.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
41
|
+
eflips_depot-4.3.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|