mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-07-21 01:08:12 +00:00
fix: price interpolation (#1154)
Use forward fill to interpolate time series data that represents prices: - elecprice_marketprice_wh - feed_in_tariff_wh Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
This commit is contained in:
@@ -241,7 +241,8 @@ class TestElecPriceFixed:
|
||||
hourly_array = await provider.key_to_array(
|
||||
key="elecprice_marketprice_wh",
|
||||
start_datetime=start_dt,
|
||||
end_datetime=start_dt.add(hours=24)
|
||||
end_datetime=start_dt.add(hours=24),
|
||||
fill_method="ffill",
|
||||
)
|
||||
|
||||
assert len(hourly_array) == 24
|
||||
@@ -253,7 +254,8 @@ class TestElecPriceFixed:
|
||||
key="elecprice_marketprice_wh",
|
||||
start_datetime=start_dt,
|
||||
end_datetime=start_dt.add(hours=24),
|
||||
interval="15 minutes"
|
||||
interval="15 minutes",
|
||||
fill_method="ffill",
|
||||
)
|
||||
|
||||
assert len(quarter_hour_array) == 96 # 24 * 4
|
||||
@@ -266,7 +268,8 @@ class TestElecPriceFixed:
|
||||
key="elecprice_marketprice_wh",
|
||||
start_datetime=start_dt,
|
||||
end_datetime=start_dt.add(hours=24),
|
||||
interval="30 minutes"
|
||||
interval="30 minutes",
|
||||
fill_method="ffill",
|
||||
)
|
||||
|
||||
assert len(half_hour_array) == 48 # 24 * 2
|
||||
|
||||
Reference in New Issue
Block a user