Skip to content

Commit f2d49b3

Browse files
committed
Correct typo and update tests for new error messages in match_centroids
1 parent 07a4a73 commit f2d49b3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

climada/util/coordinates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ def match_centroids(
12461246
try:
12471247
if not equal_crs(coord_gdf.crs, centroids.crs):
12481248
raise ValueError(
1249-
"Please provide coord_gdf and centroids defined in" " a common CRS."
1249+
"Please provide coord_gdf and centroids defined in a common CRS."
12501250
)
12511251
if coord_gdf.crs is None or centroids.crs is None:
12521252
raise ValueError(

climada/util/test/test_coordinates.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,8 @@ def test_match_centroids(self):
954954
with self.assertRaises(ValueError) as cm:
955955
u_coord.match_centroids(gdf, centroids)
956956
self.assertIn(
957-
"Set hazard and GeoDataFrame to same CRS first!", str(cm.exception)
957+
"Please provide coord_gdf and centroids defined in a common CRS.",
958+
str(cm.exception),
958959
)
959960

960961
# Test 4: no crs
@@ -971,8 +972,7 @@ def test_match_centroids(self):
971972
with self.assertRaises(ValueError) as cm:
972973
u_coord.match_centroids(gdf, centroids)
973974
self.assertIn(
974-
"Please provide coordinate GeoDataFrame and "
975-
"Hazard object with a valid crs attribute.",
975+
"Please provide coord_gdf and centroids with valid crs attributes.",
976976
str(cm.exception),
977977
)
978978

0 commit comments

Comments
 (0)