eflips-depot 4.13.4__py3-none-any.whl → 4.13.5__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.
@@ -106,26 +106,54 @@ class ConsumptionInformation:
106
106
  :return: The energy consumption in kWh. This is already the consumption for the whole trip.
107
107
  """
108
108
 
109
- # Make sure the consumption lut has 4 dimensions and the columns are in the correct order
110
- if self.consumption_lut.columns != [
111
- "incline",
112
- "t_amb",
113
- "level_of_loading",
114
- "mean_speed_kmh",
115
- ]:
109
+ # Make sure the consumption lut has 4 dimensions with the correct columns
110
+ if not all(
111
+ col in self.consumption_lut.columns
112
+ for col in [
113
+ "incline",
114
+ "t_amb",
115
+ "level_of_loading",
116
+ "mean_speed_kmh",
117
+ ]
118
+ ):
116
119
  raise ValueError(
117
120
  "The consumption LUT must have the columns 'incline', 't_amb', 'level_of_loading', 'mean_speed_kmh'"
118
121
  )
119
122
 
120
123
  # Recover the scales along each of the four axes from the datapoints
121
- incline_scale = sorted(set([x[0] for x in self.consumption_lut.data_points]))
124
+
125
+ incline_scale = sorted(
126
+ set(
127
+ [
128
+ x[self.consumption_lut.columns.index("incline")]
129
+ for x in self.consumption_lut.data_points
130
+ ]
131
+ )
132
+ )
122
133
  temperature_scale = sorted(
123
- set([x[1] for x in self.consumption_lut.data_points])
134
+ set(
135
+ [
136
+ x[self.consumption_lut.columns.index("t_amb")]
137
+ for x in self.consumption_lut.data_points
138
+ ]
139
+ )
124
140
  )
125
141
  level_of_loading_scale = sorted(
126
- set([x[2] for x in self.consumption_lut.data_points])
142
+ set(
143
+ [
144
+ x[self.consumption_lut.columns.index("level_of_loading")]
145
+ for x in self.consumption_lut.data_points
146
+ ]
147
+ )
148
+ )
149
+ speed_scale = sorted(
150
+ set(
151
+ [
152
+ x[self.consumption_lut.columns.index("mean_speed_kmh")]
153
+ for x in self.consumption_lut.data_points
154
+ ]
155
+ )
127
156
  )
128
- speed_scale = sorted(set([x[3] for x in self.consumption_lut.data_points]))
129
157
 
130
158
  # Create the 4d array
131
159
  consumption_lut = np.zeros(
@@ -286,6 +314,14 @@ def extract_trip_information(
286
314
  temperature = temperature_for_trip(trip_id, session)
287
315
 
288
316
  payload_mass = passenger_mass * passenger_count
317
+ assert (
318
+ trip.rotation.vehicle_type.allowed_mass is not None
319
+ ), f"allowed_mass of vehicle {trip.rotation.vehicle_type} must be set"
320
+
321
+ assert (
322
+ trip.rotation.vehicle_type.empty_mass is not None
323
+ ), f"empty_mass of vehicle {trip.rotation.vehicle_type} must be set"
324
+
289
325
  full_payload = (
290
326
  trip.rotation.vehicle_type.allowed_mass
291
327
  - trip.rotation.vehicle_type.empty_mass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: eflips-depot
3
- Version: 4.13.4
3
+ Version: 4.13.5
4
4
  Summary: Depot Simulation for eFLIPS
5
5
  License: AGPL-3.0-or-later
6
6
  Author: Enrico Lauth
@@ -2,7 +2,7 @@ eflips/depot/__init__.py,sha256=I42xmkE7GDZfoZeSn_ey85sYGI7xyGqAt6Xd4UZpHLw,2872
2
2
  eflips/depot/api/__init__.py,sha256=I0KQ_lDAWWPaH4HJfNLPxkv2eFKai9by2WqX0AKNsP4,58571
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/consumption.py,sha256=ICgToPQtUBvVhTwz5_oVrNKRUnM_0HGxWrH4Tby9IQ0,27776
5
+ eflips/depot/api/private/consumption.py,sha256=wlC3uKD0H9XjES2Jfow4PTzQ0Jd7fxryIj57H1mY50g,28743
6
6
  eflips/depot/api/private/depot.py,sha256=NLrRBjb-wq7E3hnVAiX08IzUSVjfMV_NgRqzIx53CE0,44120
7
7
  eflips/depot/api/private/results_to_database.py,sha256=FBlZRKqAIG80tFyuf5vCGHRycWKYkm53jFxJEk9t1NA,25984
8
8
  eflips/depot/api/private/util.py,sha256=DasTkuGUhlBpY_BtTFWoxSNZU_CRyM3RqEDgO07Eks8,17990
@@ -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.13.4.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
40
- eflips_depot-4.13.4.dist-info/METADATA,sha256=d6pp3rq0_9aYTEzRfdcLgaevh6GiC4BRdHrsYBHU0Po,5936
41
- eflips_depot-4.13.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
42
- eflips_depot-4.13.4.dist-info/RECORD,,
39
+ eflips_depot-4.13.5.dist-info/LICENSE.md,sha256=KB4XTk1fPHjtZCYDyPyreu6h1LVJVZXYg-5vePcWZAc,34143
40
+ eflips_depot-4.13.5.dist-info/METADATA,sha256=Kqpu7ovbq_bx3MkZbE2_SDAqfp9mWkFp2G_hYUWmwBI,5936
41
+ eflips_depot-4.13.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
42
+ eflips_depot-4.13.5.dist-info/RECORD,,