eflips-depot 4.6.5__tar.gz → 4.6.6__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.
Files changed (43) hide show
  1. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/PKG-INFO +1 -1
  2. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/api/__init__.py +11 -1
  3. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/api/private/consumption.py +3 -2
  4. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/pyproject.toml +1 -1
  5. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/LICENSE.md +0 -0
  6. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/README.md +0 -0
  7. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/__init__.py +0 -0
  8. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/api/defaults/default_settings.json +0 -0
  9. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/api/private/__init__.py +0 -0
  10. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/api/private/depot.py +0 -0
  11. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/api/private/results_to_database.py +0 -0
  12. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/api/private/smart_charging.py +0 -0
  13. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/api/private/util.py +0 -0
  14. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/configuration.py +0 -0
  15. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/depot.py +0 -0
  16. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/evaluation.py +0 -0
  17. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/filters.py +0 -0
  18. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/input_epex_power_price.py +0 -0
  19. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/__init__.py +0 -0
  20. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/doc/__init__.py +0 -0
  21. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/doc/direct_details.pdf +0 -0
  22. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/evaluation.py +0 -0
  23. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/opt_tools/__init__.py +0 -0
  24. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/opt_tools/crossover.py +0 -0
  25. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/opt_tools/fitness_c_urfd.py +0 -0
  26. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/opt_tools/fitness_util.py +0 -0
  27. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/opt_tools/init.py +0 -0
  28. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/opt_tools/mutation.py +0 -0
  29. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/optimize_c_urfd.py +0 -0
  30. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/packing.py +0 -0
  31. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/settings.py +0 -0
  32. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/template_creation.py +0 -0
  33. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/layout_opt/util.py +0 -0
  34. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/plots.py +0 -0
  35. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/processes.py +0 -0
  36. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/rating.py +0 -0
  37. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/resources.py +0 -0
  38. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/settings_config.py +0 -0
  39. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/simple_vehicle.py +0 -0
  40. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/simulation.py +0 -0
  41. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/smart_charging.py +0 -0
  42. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/standalone.py +0 -0
  43. {eflips_depot-4.6.5 → eflips_depot-4.6.6}/eflips/depot/validation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eflips-depot
3
- Version: 4.6.5
3
+ Version: 4.6.6
4
4
  Summary: Depot Simulation for eFLIPS
5
5
  License: AGPL-3.0-or-later
6
6
  Author: Enrico Lauth
@@ -266,8 +266,18 @@ def simple_consumption_simulation(
266
266
  vehicles = (
267
267
  session.query(Vehicle).filter(Vehicle.scenario_id == scenario.id).all()
268
268
  )
269
+
270
+ # Get the event count for each vbehicle in a single query using a groub_py clause
271
+ vehicle_event_count_q = (
272
+ session.query(Event.vehicle_id, sqlalchemy.func.count(Event.id))
273
+ .join(Vehicle)
274
+ .filter(Vehicle.scenario_id == scenario.id)
275
+ .group_by(Event.vehicle_id)
276
+ )
277
+ vehicle_event_count = dict(vehicle_event_count_q.all())
278
+
269
279
  for vehicle in vehicles:
270
- if session.query(Event).filter(Event.vehicle_id == vehicle.id).count() == 0:
280
+ if vehicle.id not in vehicle_event_count.keys():
271
281
  add_initial_standby_event(vehicle, session)
272
282
 
273
283
  # Since we are doing no_autoflush blocks later, we need to flush the session once here so that unflushed stuff
@@ -78,13 +78,14 @@ def add_initial_standby_event(
78
78
  but changes are not yet committed.
79
79
  """
80
80
 
81
- earliest_trip = (
81
+ earliest_trip_q = (
82
82
  session.query(Trip)
83
83
  .join(Rotation)
84
84
  .filter(Rotation.vehicle == vehicle)
85
85
  .order_by(Trip.departure_time)
86
- .first()
86
+ .limit(1)
87
87
  )
88
+ earliest_trip = earliest_trip_q.one_or_none()
88
89
  if earliest_trip is None:
89
90
  warnings.warn(
90
91
  f"No trips found for vehicle {vehicle.id}. Cannot add initial standby event.",
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "eflips-depot"
3
- version = "4.6.5"
3
+ version = "4.6.6"
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",
File without changes
File without changes