eflips-depot 4.12.1__py3-none-any.whl → 4.13.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.
- eflips/depot/api/__init__.py +17 -16
- eflips/depot/api/private/util.py +2 -1
- {eflips_depot-4.12.1.dist-info → eflips_depot-4.13.0.dist-info}/METADATA +3 -3
- {eflips_depot-4.12.1.dist-info → eflips_depot-4.13.0.dist-info}/RECORD +6 -6
- {eflips_depot-4.12.1.dist-info → eflips_depot-4.13.0.dist-info}/LICENSE.md +0 -0
- {eflips_depot-4.12.1.dist-info → eflips_depot-4.13.0.dist-info}/WHEEL +0 -0
eflips/depot/api/__init__.py
CHANGED
|
@@ -1135,13 +1135,11 @@ def generate_depot_optimal_size(
|
|
|
1135
1135
|
logger = logging.getLogger(__name__)
|
|
1136
1136
|
|
|
1137
1137
|
with create_session(scenario, database_url) as (session, scenario):
|
|
1138
|
-
# Delete all
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
session.query(Vehicle).filter(Vehicle.scenario_id == scenario.id).delete()
|
|
1138
|
+
# Delete all depot events
|
|
1139
|
+
session.query(Event).filter(
|
|
1140
|
+
Event.scenario_id == scenario.id, Event.area_id.isnot(None)
|
|
1141
|
+
).delete()
|
|
1143
1142
|
|
|
1144
|
-
# Handles existing depot
|
|
1145
1143
|
if session.query(Depot).filter(Depot.scenario_id == scenario.id).count() != 0:
|
|
1146
1144
|
if delete_existing_depot is False:
|
|
1147
1145
|
raise ValueError(
|
|
@@ -1150,6 +1148,15 @@ def generate_depot_optimal_size(
|
|
|
1150
1148
|
|
|
1151
1149
|
delete_depots(scenario, session)
|
|
1152
1150
|
|
|
1151
|
+
outer_savepoint = session.begin_nested()
|
|
1152
|
+
# Delete all vehicles and events, also disconnect the vehicles from the rotations
|
|
1153
|
+
rotation_q = session.query(Rotation).filter(Rotation.scenario_id == scenario.id)
|
|
1154
|
+
rotation_q.update({"vehicle_id": None})
|
|
1155
|
+
session.query(Event).filter(Event.scenario_id == scenario.id).delete()
|
|
1156
|
+
session.query(Vehicle).filter(Vehicle.scenario_id == scenario.id).delete()
|
|
1157
|
+
|
|
1158
|
+
# Handles existing depot
|
|
1159
|
+
|
|
1153
1160
|
##### Step 0: Consumption Simulation #####
|
|
1154
1161
|
# Run the consumption simulation for all depots
|
|
1155
1162
|
|
|
@@ -1189,7 +1196,7 @@ def generate_depot_optimal_size(
|
|
|
1189
1196
|
len(rotations) for vehicle_type, rotations in vehicle_type_dict.items()
|
|
1190
1197
|
)
|
|
1191
1198
|
|
|
1192
|
-
|
|
1199
|
+
inner_savepoint = session.begin_nested()
|
|
1193
1200
|
try:
|
|
1194
1201
|
# (Temporarily) Delete all rotations not starting or ending at the station
|
|
1195
1202
|
logger.debug(
|
|
@@ -1228,10 +1235,11 @@ def generate_depot_optimal_size(
|
|
|
1228
1235
|
depot_capacities_for_scenario[station] = vt_capacities_for_station
|
|
1229
1236
|
num_rotations_for_scenario[station] = rotation_count_depot
|
|
1230
1237
|
finally:
|
|
1231
|
-
|
|
1238
|
+
inner_savepoint.rollback()
|
|
1232
1239
|
|
|
1233
|
-
|
|
1240
|
+
outer_savepoint.rollback()
|
|
1234
1241
|
|
|
1242
|
+
# Create depot using the calculated capacities
|
|
1235
1243
|
for depot_station, capacities in depot_capacities_for_scenario.items():
|
|
1236
1244
|
generate_depot(
|
|
1237
1245
|
capacities,
|
|
@@ -1243,10 +1251,3 @@ def generate_depot_optimal_size(
|
|
|
1243
1251
|
num_shunting_slots=num_rotations_for_scenario[depot_station] // 10,
|
|
1244
1252
|
num_cleaning_slots=num_rotations_for_scenario[depot_station] // 10,
|
|
1245
1253
|
)
|
|
1246
|
-
|
|
1247
|
-
# Delete all vehicles and events again. Only depot layout is kept
|
|
1248
|
-
|
|
1249
|
-
rotation_q = session.query(Rotation).filter(Rotation.scenario_id == scenario.id)
|
|
1250
|
-
rotation_q.update({"vehicle_id": None})
|
|
1251
|
-
session.query(Event).filter(Event.scenario_id == scenario.id).delete()
|
|
1252
|
-
session.query(Vehicle).filter(Vehicle.scenario_id == scenario.id).delete()
|
eflips/depot/api/private/util.py
CHANGED
|
@@ -18,7 +18,8 @@ from eflips.model import (
|
|
|
18
18
|
Depot,
|
|
19
19
|
Temperatures,
|
|
20
20
|
)
|
|
21
|
-
from
|
|
21
|
+
from eflips.model import create_engine
|
|
22
|
+
from sqlalchemy import inspect
|
|
22
23
|
from sqlalchemy.orm import Session
|
|
23
24
|
|
|
24
25
|
from eflips.depot import SimpleTrip, Timetable as EflipsTimeTable
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: eflips-depot
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.13.0
|
|
4
4
|
Summary: Depot Simulation for eFLIPS
|
|
5
5
|
License: AGPL-3.0-or-later
|
|
6
6
|
Author: Enrico Lauth
|
|
@@ -13,8 +13,8 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
15
15
|
Requires-Dist: eflips (>=0.1.3,<0.2.0)
|
|
16
|
-
Requires-Dist: eflips-model (
|
|
17
|
-
Requires-Dist: eflips-opt (>=0.3.
|
|
16
|
+
Requires-Dist: eflips-model (>=10.0.0,<11.0.0)
|
|
17
|
+
Requires-Dist: eflips-opt (>=0.3.0,<0.4.0)
|
|
18
18
|
Requires-Dist: pandas (>=2.2.0,<3.0.0)
|
|
19
19
|
Requires-Dist: scipy (>=1.14.0,<2.0.0)
|
|
20
20
|
Requires-Dist: simpy (>=4.0.1,<5.0.0)
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
eflips/depot/__init__.py,sha256=06GUem0JIEunIyJ0_P_MLAGfibGEnNqcPPY0OBpO2NQ,1662
|
|
2
|
-
eflips/depot/api/__init__.py,sha256=
|
|
2
|
+
eflips/depot/api/__init__.py,sha256=bxxRaknhMc_9xxBATFe_bcGzZQI9sYDhYwRF5Z74B1E,55055
|
|
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/consumption.py,sha256=nImegyhKrZlEwKTNdmAmDxjTQCvwfPgxA588e0M_F9o,27282
|
|
6
6
|
eflips/depot/api/private/depot.py,sha256=YyC_jMDGkg8yOAiYkKzb5HboFM1P4x-GTJSfD8srdvE,43640
|
|
7
7
|
eflips/depot/api/private/results_to_database.py,sha256=_qXB9046dWHek4ys669J3IojJt4xlZRkW1HxT7OTLFo,25524
|
|
8
|
-
eflips/depot/api/private/util.py,sha256=
|
|
8
|
+
eflips/depot/api/private/util.py,sha256=DasTkuGUhlBpY_BtTFWoxSNZU_CRyM3RqEDgO07Eks8,17990
|
|
9
9
|
eflips/depot/configuration.py,sha256=Op3hlir-dEN7yHr0kTqbYANoCBKFWK6uKOv3NJl8w_w,35678
|
|
10
10
|
eflips/depot/depot.py,sha256=pREutXtJlDxjgfwRobAy7UqTHh-tldbVWHN8DIyxs8s,106986
|
|
11
11
|
eflips/depot/evaluation.py,sha256=qqXyP4jA1zFcKuWhliQ6n25ZlGl9mJV-vtXf0yu8WN8,140842
|
|
@@ -36,7 +36,7 @@ eflips/depot/simulation.py,sha256=ee0qTzOzG-8ybN36ie_NJallXfC7jUaS9JZvaYFziLs,10
|
|
|
36
36
|
eflips/depot/smart_charging.py,sha256=C3BYqzn2-OYY4ipXm0ETtavbAM9QXZMYULBpVoChf0E,54311
|
|
37
37
|
eflips/depot/standalone.py,sha256=8O01zEXghFG9zZBu0fUD0sXvbHQ-AXw6RB5M750a_sM,22419
|
|
38
38
|
eflips/depot/validation.py,sha256=TIuY7cQtEJI4H2VVMSuY5IIVkacEEZ67weeMuY3NSAM,7097
|
|
39
|
-
eflips_depot-4.
|
|
40
|
-
eflips_depot-4.
|
|
41
|
-
eflips_depot-4.
|
|
42
|
-
eflips_depot-4.
|
|
39
|
+
eflips_depot-4.13.0.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
|
|
40
|
+
eflips_depot-4.13.0.dist-info/METADATA,sha256=82eSbc6SK6ZRm8TyyGQTUzHdB1ELolId_gLS7BCxjTY,5987
|
|
41
|
+
eflips_depot-4.13.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
42
|
+
eflips_depot-4.13.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|