From af647ff1ef4b0b0246d6ab2ae7c14f74f7c6753d Mon Sep 17 00:00:00 2001 From: Sukhil Patel Date: Tue, 19 Nov 2024 17:21:58 +0000 Subject: [PATCH] Remove unused logic --- .../torch_datasets/process_and_combine.py | 23 ------------------- ocf_data_sampler/torch_datasets/site.py | 2 +- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/ocf_data_sampler/torch_datasets/process_and_combine.py b/ocf_data_sampler/torch_datasets/process_and_combine.py index 71420f6..27ff681 100644 --- a/ocf_data_sampler/torch_datasets/process_and_combine.py +++ b/ocf_data_sampler/torch_datasets/process_and_combine.py @@ -10,7 +10,6 @@ convert_satellite_to_numpy_batch, convert_gsp_to_numpy_batch, make_sun_position_numpy_batch, - convert_site_to_numpy_batch, ) from ocf_data_sampler.numpy_batch.gsp import GSPBatchKey from ocf_data_sampler.numpy_batch.nwp import NWPBatchKey @@ -74,18 +73,6 @@ def process_and_combine_datasets( } ) - - if "site" in dataset_dict: - site_config = config.input_data.site - da_sites = dataset_dict["site"] - da_sites = da_sites / da_sites.capacity_kwp - - numpy_modalities.append( - convert_site_to_numpy_batch( - da_sites, t0_idx=-site_config.interval_start_minutes / site_config.time_resolution_minutes - ) - ) - if target_key == 'gsp': # Make sun coords NumpyBatch datetimes = pd.date_range( @@ -96,16 +83,6 @@ def process_and_combine_datasets( lon, lat = osgb_to_lon_lat(location.x, location.y) - elif target_key == 'site': - # Make sun coords NumpyBatch - datetimes = pd.date_range( - t0+minutes(site_config.interval_start_minutes), - t0+minutes(site_config.interval_end_minutes), - freq=minutes(site_config.time_resolution_minutes), - ) - - lon, lat = location.x, location.y - numpy_modalities.append( make_sun_position_numpy_batch(datetimes, lon, lat, key_prefix=target_key) ) diff --git a/ocf_data_sampler/torch_datasets/site.py b/ocf_data_sampler/torch_datasets/site.py index 4868303..96d5c8c 100644 --- a/ocf_data_sampler/torch_datasets/site.py +++ b/ocf_data_sampler/torch_datasets/site.py @@ -15,7 +15,7 @@ slice_datasets_by_time, slice_datasets_by_space ) from ocf_data_sampler.utils import minutes -from ocf_data_sampler.torch_datasets.process_and_combine import process_and_combine_site_sample_dict, compute +from ocf_data_sampler.torch_datasets.process_and_combine import process_and_combine_site_sample_dict from ocf_data_sampler.torch_datasets.valid_time_periods import find_valid_time_periods xr.set_options(keep_attrs=True)