eflips-depot 4.13.3__py3-none-any.whl → 4.13.4__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/private/consumption.py +25 -11
- {eflips_depot-4.13.3.dist-info → eflips_depot-4.13.4.dist-info}/METADATA +1 -1
- {eflips_depot-4.13.3.dist-info → eflips_depot-4.13.4.dist-info}/RECORD +5 -5
- {eflips_depot-4.13.3.dist-info → eflips_depot-4.13.4.dist-info}/LICENSE.md +0 -0
- {eflips_depot-4.13.3.dist-info → eflips_depot-4.13.4.dist-info}/WHEEL +0 -0
|
@@ -5,9 +5,9 @@ from datetime import timedelta, datetime
|
|
|
5
5
|
from math import ceil
|
|
6
6
|
from typing import Tuple, List
|
|
7
7
|
from zoneinfo import ZoneInfo
|
|
8
|
-
import scipy
|
|
9
8
|
|
|
10
9
|
import numpy as np
|
|
10
|
+
import scipy
|
|
11
11
|
import sqlalchemy.orm
|
|
12
12
|
from eflips.model import (
|
|
13
13
|
Event,
|
|
@@ -99,7 +99,9 @@ class ConsumptionInformation:
|
|
|
99
99
|
|
|
100
100
|
def calculate(self):
|
|
101
101
|
"""
|
|
102
|
-
Calculates the consumption for the trip.
|
|
102
|
+
Calculates the consumption for the trip.
|
|
103
|
+
|
|
104
|
+
Returns a float in kWh.
|
|
103
105
|
|
|
104
106
|
:return: The energy consumption in kWh. This is already the consumption for the whole trip.
|
|
105
107
|
"""
|
|
@@ -171,12 +173,26 @@ class ConsumptionInformation:
|
|
|
171
173
|
ConsistencyWarning,
|
|
172
174
|
)
|
|
173
175
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
x, y, z, alpha = np.meshgrid(
|
|
177
|
+
incline_scale,
|
|
178
|
+
temperature_scale,
|
|
179
|
+
level_of_loading_scale,
|
|
180
|
+
speed_scale,
|
|
181
|
+
indexing="ij",
|
|
182
|
+
)
|
|
183
|
+
points_array = np.column_stack(
|
|
184
|
+
[x.ravel(), y.ravel(), z.ravel(), alpha.ravel()]
|
|
185
|
+
)
|
|
186
|
+
consumption_lut_flattened = consumption_lut.ravel()
|
|
187
|
+
|
|
188
|
+
# Remove the NaN entries from consumption_lut and points_array
|
|
189
|
+
valid_mask = ~np.isnan(consumption_lut_flattened)
|
|
190
|
+
points_array = points_array[valid_mask]
|
|
191
|
+
consumption_lut = consumption_lut_flattened[valid_mask]
|
|
192
|
+
|
|
193
|
+
interpolator_nn = scipy.interpolate.NearestNDInterpolator(
|
|
194
|
+
x=points_array,
|
|
195
|
+
y=consumption_lut.ravel(),
|
|
180
196
|
)
|
|
181
197
|
consumption_per_km = interpolator_nn(
|
|
182
198
|
[
|
|
@@ -228,9 +244,7 @@ def extract_trip_information(
|
|
|
228
244
|
passenger_mass=68,
|
|
229
245
|
passenger_count=17.6,
|
|
230
246
|
) -> ConsumptionInformation:
|
|
231
|
-
"""
|
|
232
|
-
Extracts the information needed for the consumption simulation from a trip.
|
|
233
|
-
"""
|
|
247
|
+
"""Extracts the information needed for the consumption simulation from a trip."""
|
|
234
248
|
|
|
235
249
|
with create_session(scenario) as (session, scenario):
|
|
236
250
|
# Load the trip with its route and rotation, including vehicle type and consumption LUT
|
|
@@ -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=
|
|
5
|
+
eflips/depot/api/private/consumption.py,sha256=ICgToPQtUBvVhTwz5_oVrNKRUnM_0HGxWrH4Tby9IQ0,27776
|
|
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.
|
|
40
|
-
eflips_depot-4.13.
|
|
41
|
-
eflips_depot-4.13.
|
|
42
|
-
eflips_depot-4.13.
|
|
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,,
|
|
File without changes
|
|
File without changes
|