File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/anemoi/datasets/create/input Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ def transform(self, group_of_dates):
72
72
end += self .frequency
73
73
74
74
to_try = sorted (to_try - self .tried )
75
+ info = {k : "no-data" for k in to_try }
76
+
77
+ if not to_try :
78
+ LOG .warning (f"No new dates to try for { group_of_dates } in { self .source } " )
79
+ # return []
75
80
76
81
if to_try :
77
82
result = self .source .select (
@@ -82,19 +87,32 @@ def transform(self, group_of_dates):
82
87
)
83
88
)
84
89
90
+ cnt = 0
85
91
for f in result .datasource :
92
+ cnt += 1
86
93
# We could keep the fields in a dictionary, but we don't want to keep the fields in memory
87
94
date = as_datetime (f .metadata ("valid_datetime" ))
88
95
89
96
if self .skip_all_nans :
90
97
if np .isnan (f .to_numpy ()).all ():
91
98
LOG .warning (f"Skipping { date } because all values are NaN" )
99
+ info [date ] = "all-nans"
92
100
continue
93
101
102
+ info [date ] = "ok"
94
103
self .found .add (date )
95
104
105
+ if cnt == 0 :
106
+ raise ValueError (f"No data found for { group_of_dates } in { self .source } " )
107
+
96
108
self .tried .update (to_try )
97
109
110
+ if not self .found :
111
+ for k , v in info .items ():
112
+ LOG .warning (f"{ k } : { v } " )
113
+
114
+ raise ValueError (f"No matching data found for { asked_dates } in { self .source } " )
115
+
98
116
new_dates = defaultdict (list )
99
117
100
118
for date in asked_dates :
You can’t perform that action at this time.
0 commit comments