Skip to content

Commit

Permalink
PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdudfield committed Jan 22, 2025
1 parent 936bb87 commit f2a0b50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions ocf_data_sampler/torch_datasets/datasets/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def process_and_combine_site_sample_dict(

# add datetime features
datetimes = pd.DatetimeIndex(combined_sample_dataset.site__time_utc.values)
datetime_features = make_datetime_numpy_dict(datetimes=datetimes, key_prefix="site")
datetime_features = make_datetime_numpy_dict(datetimes=datetimes, key_prefix="site_")
combined_sample_dataset = combined_sample_dataset.assign_coords(
{k: ("site__time_utc", v) for k, v in datetime_features.items()}
)
Expand All @@ -251,7 +251,7 @@ def process_and_combine_site_sample_dict(
datetimes=datetimes,
lon=combined_sample_dataset.site__longitude.values,
lat=combined_sample_dataset.site__latitude.values,
key_prefix="site",
key_prefix="site_",
)
combined_sample_dataset = combined_sample_dataset.assign_coords(
{k: ("site__time_utc", v) for k, v in sun_position_features.items()}
Expand Down
24 changes: 12 additions & 12 deletions tests/torch_datasets/test_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def test_site(site_config_filename):
}

expected_coords_subset = {
"site_solar_azimuth",
"site_solar_elevation",
"site_date_cos",
"site_time_cos",
"site_time_sin",
"site_date_sin",
"site__solar_azimuth",
"site__solar_elevation",
"site__date_cos",
"site__time_cos",
"site__time_sin",
"site__date_sin",
}

expected_data_vars = {"nwp-ukv", "satellite", "site"}
Expand Down Expand Up @@ -114,12 +114,12 @@ def test_site_dataset_with_dataloader(site_config_filename):
dataset = SitesDataset(site_config_filename)

expected_coods = {
"site_solar_azimuth",
"site_solar_elevation",
"site_date_cos",
"site_time_cos",
"site_time_sin",
"site_date_sin",
"site__solar_azimuth",
"site__solar_elevation",
"site__date_cos",
"site__time_cos",
"site__time_sin",
"site__date_sin",
}

sample = dataset[0]
Expand Down

0 comments on commit f2a0b50

Please sign in to comment.