Skip to content

Commit

Permalink
test_vec_ras: fix TestCentroids.test_centroids_check_pass
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuel-schmid committed Nov 29, 2023
1 parent 5b37116 commit 78811c5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions climada/hazard/centroids/test/test_vec_ras.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
REGION_ID = np.array([776, 242, 578, 0, 10, 218])

TEST_CRS = 'EPSG:4326'
ALT_CRS = 'eps:32632' #Europe
ALT_CRS = 'epsg:32632' #Europe

class TestVector(unittest.TestCase):
"""Test CentroidsVector class"""
Expand Down Expand Up @@ -375,13 +375,11 @@ class TestCentroids(unittest.TestCase):

def test_centroids_check_pass(self):
"""Test vector data in Centroids"""
data_vec = data_vector()
lat, lon, geometry = data_vec
centr = Centroids(latitude=lat, longitude=lon, crs=geometry.crs)
centr = Centroids(latitude=VEC_LAT, longitude=VEC_LON, crs=ALT_CRS)

self.assertTrue(u_coord.equal_crs(centr.crs, data_vec[2].crs))
for i in range(4):
self.assertEqual(centr.total_bounds[i], data_vec[2].total_bounds[i])
self.assertTrue(u_coord.equal_crs(centr.crs, CRS.from_user_input(ALT_CRS)))
self.assertEqual(list(centr.total_bounds),
[VEC_LON.min(), VEC_LAT.min(), VEC_LON.max(), VEC_LAT.max()])

self.assertIsInstance(centr.lat, np.ndarray)
self.assertIsInstance(centr.lon, np.ndarray)
Expand Down

0 comments on commit 78811c5

Please sign in to comment.