ocf-data-sampler 0.2.7__py3-none-any.whl → 0.2.8__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 ocf-data-sampler might be problematic. Click here for more details.
- ocf_data_sampler/select/dropout.py +7 -4
- {ocf_data_sampler-0.2.7.dist-info → ocf_data_sampler-0.2.8.dist-info}/METADATA +2 -2
- {ocf_data_sampler-0.2.7.dist-info → ocf_data_sampler-0.2.8.dist-info}/RECORD +5 -5
- {ocf_data_sampler-0.2.7.dist-info → ocf_data_sampler-0.2.8.dist-info}/WHEEL +1 -1
- {ocf_data_sampler-0.2.7.dist-info → ocf_data_sampler-0.2.8.dist-info}/top_level.txt +0 -0
|
@@ -33,7 +33,7 @@ def draw_dropout_time(
|
|
|
33
33
|
raise ValueError("dropout_frac must be between 0 and 1 inclusive")
|
|
34
34
|
|
|
35
35
|
if (len(dropout_timedeltas) == 0) or (np.random.uniform() >= dropout_frac):
|
|
36
|
-
dropout_time =
|
|
36
|
+
dropout_time = None
|
|
37
37
|
else:
|
|
38
38
|
dropout_time = t0 + np.random.choice(dropout_timedeltas)
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ def draw_dropout_time(
|
|
|
42
42
|
|
|
43
43
|
def apply_dropout_time(
|
|
44
44
|
ds: xr.DataArray,
|
|
45
|
-
dropout_time: pd.Timestamp,
|
|
45
|
+
dropout_time: pd.Timestamp | None,
|
|
46
46
|
) -> xr.DataArray:
|
|
47
47
|
"""Apply dropout time to the data.
|
|
48
48
|
|
|
@@ -50,5 +50,8 @@ def apply_dropout_time(
|
|
|
50
50
|
ds: Xarray DataArray with 'time_utc' coordinate
|
|
51
51
|
dropout_time: Time after which data is set to NaN
|
|
52
52
|
"""
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
if dropout_time is None:
|
|
54
|
+
return ds
|
|
55
|
+
else:
|
|
56
|
+
# This replaces the times after the dropout with NaNs
|
|
57
|
+
return ds.where(ds.time_utc <= dropout_time)
|
|
@@ -34,7 +34,7 @@ ocf_data_sampler/sample/base.py,sha256=cQ1oIyhdmlotejZK8B3Cw6MNvpdnBPD8G_o2h7Ye4
|
|
|
34
34
|
ocf_data_sampler/sample/site.py,sha256=BhQPygeLUncXJGN_Yd2CL050kN6ktZlobaJw0O0RagI,1290
|
|
35
35
|
ocf_data_sampler/sample/uk_regional.py,sha256=VOby07RnZYvzszExwqoZRVwZ1EbCclRpXq1e9CL16CE,2463
|
|
36
36
|
ocf_data_sampler/select/__init__.py,sha256=E4AJulEbO2K-o0UlG1fgaEteuf_1ZFjHTvrotXSb4YU,332
|
|
37
|
-
ocf_data_sampler/select/dropout.py,sha256=
|
|
37
|
+
ocf_data_sampler/select/dropout.py,sha256=WVOCweTGfIjufAlnfmYiPofz6X38TxQgzkLwtiB3TrU,1712
|
|
38
38
|
ocf_data_sampler/select/fill_time_periods.py,sha256=TlGxp1xiAqnhdWfLy0pv3FuZc00dtimjWdLzr4JoTGA,865
|
|
39
39
|
ocf_data_sampler/select/find_contiguous_time_periods.py,sha256=cEXrQDzk8pXknxB0q3v5DakosagHMoLDAj302B8Xpw0,11537
|
|
40
40
|
ocf_data_sampler/select/geospatial.py,sha256=CDExkl36eZOKmdJPzUr_K0Wn3axHqv5nYo-EkSiINcc,5032
|
|
@@ -52,7 +52,7 @@ ocf_data_sampler/torch_datasets/utils/merge_and_fill_utils.py,sha256=we7BTxRH7B7
|
|
|
52
52
|
ocf_data_sampler/torch_datasets/utils/valid_time_periods.py,sha256=xcy75cVxl0WrglnX5YUAFjXXlO2GwEBHWyqo8TDuiOA,4714
|
|
53
53
|
scripts/refactor_site.py,sha256=skzvsPP0Cn9yTKndzkilyNcGz4DZ88ctvCJ0XrBdc2A,3135
|
|
54
54
|
utils/compute_icon_mean_stddev.py,sha256=a1oWMRMnny39rV-dvu8rcx85sb4bXzPFrR1gkUr4Jpg,2296
|
|
55
|
-
ocf_data_sampler-0.2.
|
|
56
|
-
ocf_data_sampler-0.2.
|
|
57
|
-
ocf_data_sampler-0.2.
|
|
58
|
-
ocf_data_sampler-0.2.
|
|
55
|
+
ocf_data_sampler-0.2.8.dist-info/METADATA,sha256=vfGBLPNsG5G5dPeZmdt0H38EK1LIQexvh2-BEwmi2dc,11594
|
|
56
|
+
ocf_data_sampler-0.2.8.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
57
|
+
ocf_data_sampler-0.2.8.dist-info/top_level.txt,sha256=LEFU4Uk-PEo72QGLAfnVZIUEm37Q8mKuMeg_Xk-p33g,31
|
|
58
|
+
ocf_data_sampler-0.2.8.dist-info/RECORD,,
|
|
File without changes
|