Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 6b2bf11

Browse files
Merge pull request #687 from openclimatefix/issue/pv-data
need atleast 6 data points
2 parents a3b667e + 3ac0556 commit 6b2bf11

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

nowcasting_dataset/data_sources/pv/live.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def get_pv_power_from_database(
124124
if len(pv_yields_df) == 0:
125125
return pd.DataFrame(columns=["pv_system_id"])
126126

127-
# get the system id from 'pv_system_id=xxxx provider=.....'
127+
# get the system id from 'pv_system_id=xxxx provider=.....'
128128
pv_yields_df["pv_system_id"] = (
129129
pv_yields_df["pv_system"].astype(str).str.split(" ").str[0].str.split("=").str[-1]
130130
)
@@ -160,8 +160,8 @@ def get_pv_power_from_database(
160160
)
161161

162162
# we are going interpolate using 'quadratic' method and we need at least 3 data points,
163-
# therefore we drop system wiht less than 3 nans
164-
pv_yields_df = pv_yields_df.loc[:, pv_yields_df.notnull().sum() >= 3]
163+
# Lets make sure we have double that, therefore we drop system with less than 6 nans
164+
pv_yields_df = pv_yields_df.loc[:, pv_yields_df.notnull().sum() >= 6]
165165

166166
# interpolate in between, maximum 'live_interpolate_minutes' mins
167167
# note data is in 5 minutes chunks

tests/data_sources/pv/test_pv_live.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_get_pv_power_from_database(pv_yields_and_systems):
3232
)
3333

3434
assert len(pv_power) == 19 # 1.5 hours at 5 mins = 6*12
35-
assert len(pv_power.columns) == 3
35+
assert len(pv_power.columns) == 2
3636
assert pv_power.columns[0] == "10"
3737
assert (
3838
pd.to_datetime(pv_power.index[0]).isoformat()

0 commit comments

Comments
 (0)