eflips-depot 4.11.0__tar.gz → 4.12.0__tar.gz

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.

Files changed (42) hide show
  1. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/PKG-INFO +3 -3
  2. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/api/__init__.py +29 -11
  3. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/pyproject.toml +3 -3
  4. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/LICENSE.md +0 -0
  5. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/README.md +0 -0
  6. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/__init__.py +0 -0
  7. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/api/defaults/default_settings.json +0 -0
  8. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/api/private/__init__.py +0 -0
  9. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/api/private/consumption.py +0 -0
  10. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/api/private/depot.py +0 -0
  11. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/api/private/results_to_database.py +0 -0
  12. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/api/private/util.py +0 -0
  13. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/configuration.py +0 -0
  14. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/depot.py +0 -0
  15. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/evaluation.py +0 -0
  16. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/filters.py +0 -0
  17. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/input_epex_power_price.py +0 -0
  18. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/__init__.py +0 -0
  19. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/doc/__init__.py +0 -0
  20. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/doc/direct_details.pdf +0 -0
  21. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/evaluation.py +0 -0
  22. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/opt_tools/__init__.py +0 -0
  23. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/opt_tools/crossover.py +0 -0
  24. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/opt_tools/fitness_c_urfd.py +0 -0
  25. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/opt_tools/fitness_util.py +0 -0
  26. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/opt_tools/init.py +0 -0
  27. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/opt_tools/mutation.py +0 -0
  28. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/optimize_c_urfd.py +0 -0
  29. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/packing.py +0 -0
  30. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/settings.py +0 -0
  31. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/template_creation.py +0 -0
  32. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/layout_opt/util.py +0 -0
  33. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/plots.py +0 -0
  34. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/processes.py +0 -0
  35. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/rating.py +0 -0
  36. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/resources.py +0 -0
  37. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/settings_config.py +0 -0
  38. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/simple_vehicle.py +0 -0
  39. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/simulation.py +0 -0
  40. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/smart_charging.py +0 -0
  41. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/standalone.py +0 -0
  42. {eflips_depot-4.11.0 → eflips_depot-4.12.0}/eflips/depot/validation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eflips-depot
3
- Version: 4.11.0
3
+ Version: 4.12.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 (>=8.1.0,<9.0.0)
17
- Requires-Dist: eflips-opt (>=0.3.0,<0.4.0)
16
+ Requires-Dist: eflips-model (>8.1.0,<10.0.0)
17
+ Requires-Dist: eflips-opt (>=0.3.3,<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)
@@ -124,7 +124,8 @@ def generate_consumption_result(scenario):
124
124
  Generate consumption information for the scenario.
125
125
 
126
126
  This function retrieves the consumption LUT and vehicle classes from the database and returns a dictionary
127
- containing the consumption information for each vehicle type in the scenario.
127
+ containing the consumption information for each vehicle type in the scenario. If a trip has no corresponding
128
+ consumption LUT, it won't be included in the results.
128
129
 
129
130
  :param scenario: A :class:`eflips.model.Scenario` object containing the input data for the simulation.
130
131
 
@@ -135,10 +136,18 @@ def generate_consumption_result(scenario):
135
136
  trips = session.query(Trip).filter(Trip.scenario_id == scenario.id).all()
136
137
  consumption_results = {}
137
138
  for trip in trips:
138
- consumption_info = extract_trip_information(
139
- trip.id,
140
- scenario,
141
- )
139
+ try:
140
+ consumption_info = extract_trip_information(
141
+ trip.id,
142
+ scenario,
143
+ )
144
+ except ValueError as e:
145
+ # If the trip has no consumption information, skip it
146
+ logging.warning(
147
+ f"Skipping trip {trip.id} due to missing consumption information: {e}"
148
+ )
149
+ continue
150
+
142
151
  battery_capacity_current_vt = trip.rotation.vehicle_type.battery_capacity
143
152
  consumption_result = consumption_info.generate_consumption_result(
144
153
  battery_capacity_current_vt
@@ -1102,7 +1111,7 @@ def generate_depot_optimal_size(
1102
1111
  charging_power: float = 90,
1103
1112
  database_url: Optional[str] = None,
1104
1113
  delete_existing_depot: bool = False,
1105
- consumption_results: Optional[Dict[int, ConsumptionResult]] = None,
1114
+ use_consumption_lut: bool = False,
1106
1115
  ) -> None:
1107
1116
  """
1108
1117
  Generates an optimal depot layout with the smallest possible size for each depot in the scenario. Line charging areas
@@ -1114,8 +1123,8 @@ def generate_depot_optimal_size(
1114
1123
  :param database_url: An optional database URL. Used if no database url is given by the environment variable.
1115
1124
  :param delete_existing_depot: If there is already a depot existing in this scenario, set True to delete this
1116
1125
  existing depot. Set to False and a ValueError will be raised if there is a depot in this scenario.
1117
- :param consumption_results: A dictionary of consumption results for each vehicle type. It is used to simulate the consumption with
1118
- given look-up tables. If not given, the constant consumption will be used in the simulation.
1126
+ :param using_consumption_lut: If True, the depot layout will be generated based on the consumption lookup table.
1127
+ If False, constant consumption stored in VehicleType table will be used.
1119
1128
 
1120
1129
  :return: None. The depot layout will be added to the database.
1121
1130
 
@@ -1139,9 +1148,18 @@ def generate_depot_optimal_size(
1139
1148
 
1140
1149
  ##### Step 0: Consumption Simulation #####
1141
1150
  # Run the consumption simulation for all depots
1142
- simple_consumption_simulation(
1143
- scenario, initialize_vehicles=True, consumption_result=consumption_results
1144
- )
1151
+
1152
+ if use_consumption_lut:
1153
+ # If using the consumption lookup table, we need to calculate the consumption results
1154
+ consumption_results = generate_consumption_result(scenario)
1155
+ simple_consumption_simulation(
1156
+ scenario,
1157
+ initialize_vehicles=True,
1158
+ consumption_result=consumption_results,
1159
+ )
1160
+ else:
1161
+ # If not using the consumption lookup table, we need to initialize the vehicles with the constant consumption
1162
+ simple_consumption_simulation(scenario, initialize_vehicles=True)
1145
1163
 
1146
1164
  ##### Step 1: Find all potential depots #####
1147
1165
  # These are all the spots where a rotation starts and end
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "eflips-depot"
3
- version = "4.11.0"
3
+ version = "4.12.0"
4
4
  description = "Depot Simulation for eFLIPS"
5
5
  authors = ["Enrico Lauth <enrico.lauth@tu-berlin.de>",
6
6
  "Ludger Heide <ludger.heide@tu-berlin.de",
@@ -22,8 +22,8 @@ xlsxwriter = "^3.1.9"
22
22
  pandas = "^2.2.0"
23
23
  xlrd = "<=1.2.0"
24
24
  scipy = "^1.14.0"
25
- eflips-model = "^8.1.0"
26
- eflips-opt = "^0.3.0"
25
+ eflips-model = ">8.1.0, <10.0.0"
26
+ eflips-opt = "^0.3.3"
27
27
 
28
28
 
29
29
  [tool.pytest.ini_options]
File without changes
File without changes