Skip to content

Commit 232ef64

Browse files
committed
correct bugs
1 parent 056d346 commit 232ef64

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

‎src/weathergen/datasets/data_reader_time_conditioning.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ def __init__(
5252
self.target_idx = []
5353
self.geoinfo_idx = []
5454

55-
self.conditioning = stream_info.get("conditioning", True)
5655
self.conditioning_type = stream_info.get("conditioning_type", "time_based")
5756
value_type = stream_info.get("value_type")
5857
if isinstance(value_type, list):

‎src/weathergen/datasets/multi_stream_data_sampler.py‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def _init_stream_datasets(
230230
streams_datasets: dict[StreamName, _Stream] = {}
231231
for stream_name, stream_info in cf.streams.items():
232232
stream_info["data_paths"] = cf.get("data_paths", [])
233-
ds_type = stream_info["type"]
233+
ds_type = stream_info["type"]
234234
# list of sources for current stream
235235
streams_datasets[stream_name] = _Stream(stream_info, [])
236236
kwargs = {
@@ -251,11 +251,19 @@ def _init_stream_datasets(
251251
f"for stream name '{stream_name}'."
252252
raise ValueError(msg)
253253

254-
for fname in stream_info.get("filenames", [pathlib.Path()]):
254+
filenames_cfg = stream_info.get("filenames", [pathlib.Path()])
255+
256+
if filenames_cfg is None:
257+
filenames_cfg = [pathlib.Path()]
258+
else:
259+
pass
260+
261+
262+
for fname in filenames_cfg:
255263
fname = pathlib.Path(fname)
256264
# skip if explicitly pointing to current directory
257-
if fname is None or fname == pathlib.Path():
258-
if dataset.conditioning:
265+
if fname == pathlib.Path():
266+
if stream_info.get("conditioning", False):
259267
if is_root():
260268
logger.info(
261269
f"Opening conditioning dataset with type: {ds_type}"

0 commit comments

Comments
 (0)