Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 7737351

Browse files
committed
add verbose exception
1 parent 69473ba commit 7737351

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

nowcasting_dataset/data_sources/sun/sun_data_source.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ def get_example(self, location: SpaceTimeLocation) -> xr.Dataset:
8080
& np.isclose(locations[:, 1], y_center_osgb)
8181
]
8282
# lets make sure there is atleast one
83-
assert len(location) > 0
83+
assert len(location) > 0, (
84+
f"Could not find any locations for {location}. "
85+
f"The sun data source locations are {locations}"
86+
)
8487
# Take the first location, and x and y coordinates are the first and center entries in
8588
# this array.
8689
location = location[0]

0 commit comments

Comments
 (0)