Skip to content

Commit

Permalink
Remove unused logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukhil Patel authored and Sukhil Patel committed Nov 19, 2024
1 parent 6c3d604 commit af647ff
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
23 changes: 0 additions & 23 deletions ocf_data_sampler/torch_datasets/process_and_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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)
)
Expand Down
2 changes: 1 addition & 1 deletion ocf_data_sampler/torch_datasets/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit af647ff

Please sign in to comment.