@@ -21,16 +21,14 @@ def __init__(
21
21
self ,
22
22
pv_power_filename : Union [str , Path ],
23
23
pv_metadata_filename : Union [str , Path ],
24
- sample_period_duration : datetime .timedelta = datetime .timedelta (minutes = 5 ),
25
24
):
26
25
super ().__init__ ()
27
26
self .pv_power_filename = pv_power_filename
28
27
self .pv_metadata_filename = pv_metadata_filename
29
- self .sample_period_duration = sample_period_duration
30
28
31
29
def __iter__ (self ):
32
30
data : xr .DataArray = load_everything_into_ram (
33
- self .pv_power_filename , self .pv_metadata_filename , self . sample_period_duration
31
+ self .pv_power_filename , self .pv_metadata_filename
34
32
)
35
33
while True :
36
34
yield data
@@ -46,7 +44,7 @@ def __iter__(self):
46
44
47
45
48
46
def load_everything_into_ram (
49
- pv_power_filename , pv_metadata_filename , sample_period_duration
47
+ pv_power_filename , pv_metadata_filename
50
48
) -> xr .DataArray :
51
49
"""Open AND load PV data into RAM."""
52
50
# Load pd.DataFrame of power and pd.Series of capacities:
@@ -66,7 +64,6 @@ def load_everything_into_ram(
66
64
x_osgb = pv_metadata .x_osgb .astype (np .float32 ),
67
65
capacity_wp = pv_capacity_wp ,
68
66
pv_system_row_number = pv_system_row_number ,
69
- sample_period_duration = sample_period_duration ,
70
67
)
71
68
72
69
# Sanity checks:
@@ -251,7 +248,6 @@ def _put_pv_data_into_an_xr_dataarray(
251
248
x_osgb : pd .Series ,
252
249
capacity_wp : pd .Series ,
253
250
pv_system_row_number : pd .Series ,
254
- sample_period_duration : datetime .timedelta ,
255
251
) -> xr .DataArray :
256
252
"""Convert to an xarray DataArray.
257
253
@@ -283,7 +279,6 @@ def _put_pv_data_into_an_xr_dataarray(
283
279
)
284
280
# Sample period duration is required so PVDownsample transform knows by how much
285
281
# to change the pv_t0_idx:
286
- data_array .attrs ["sample_period_duration" ] = sample_period_duration
287
282
return data_array
288
283
289
284
0 commit comments