From f6f9220def7906f20f3e9f3a9ae8457fcc2156b7 Mon Sep 17 00:00:00 2001 From: James Fulton Date: Tue, 13 Aug 2024 11:43:51 +0000 Subject: [PATCH] clean up config check --- ocf_data_sampler/datasets/pvnet.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/ocf_data_sampler/datasets/pvnet.py b/ocf_data_sampler/datasets/pvnet.py index 198fa95..dfd2f39 100644 --- a/ocf_data_sampler/datasets/pvnet.py +++ b/ocf_data_sampler/datasets/pvnet.py @@ -67,15 +67,6 @@ def get_dataset_dict(config: Configuration) -> dict[xr.DataArray, dict[xr.DataAr in_config = config.input_data - # Check which modalities to use - # TODO: Clean these up - use_nwp = ( - (in_config.nwp is not None) - and len(in_config.nwp) != 0 - and all(v.nwp_zarr_path != "" for _, v in in_config.nwp.items()) - ) - use_sat = is_config_and_path_valid(True, in_config.satellite, "satellite_zarr_path") - datasets_dict = {} # We always assume GSP will be included @@ -85,7 +76,7 @@ def get_dataset_dict(config: Configuration) -> dict[xr.DataArray, dict[xr.DataAr datasets_dict["gsp"] = da_gsp.sel(gsp_id=slice(1, None)) # Load NWP data if in config - if use_nwp: + if in_config.nwp: datasets_dict["nwp"] = {} for nwp_source, nwp_config in in_config.nwp.items(): @@ -97,7 +88,7 @@ def get_dataset_dict(config: Configuration) -> dict[xr.DataArray, dict[xr.DataAr datasets_dict["nwp"][nwp_source] = da_nwp # Load satellite data if in config - if use_sat: + if in_config.satellite: sat_config = config.input_data.satellite da_sat = open_sat_data(sat_config.satellite_zarr_path)