Skip to content

Commit 03f4db3

Browse files
remove test grid cell area
1 parent 2e050b3 commit 03f4db3

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

climada/util/test/test_coordinates.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -565,31 +565,6 @@ def test_get_gridcellarea(self):
565565
self.assertAlmostEqual(area2[0], 1781.5973363005)
566566
self.assertTrue(area2[0] <= 2500)
567567

568-
def test_compute_grid_area(self):
569-
"""Test that the two twin functions calculate the area of a gridcell correctly. Using
570-
an absolute reference and mutual validation by comparison."""
571-
res = 1
572-
area = u_coord.compute_grid_cell_area(
573-
res=res, projection="sphere", units="km^2"
574-
)
575-
area_test, *_ = u_coord.compute_grid_cell_area_validation(res=res)
576-
577-
self.assertEqual(area.shape, (179, 359))
578-
self.assertEqual(area_test.shape, (179, 359))
579-
# check that all rows have equal area with 1e-5 tolerance for relative and absolute precision
580-
for i in range(area.shape[0]):
581-
self.assertTrue(
582-
np.all(np.isclose(area[i, :], area[i, 0], rtol=1e-5, atol=1e-5))
583-
)
584-
self.assertTrue(
585-
np.all(
586-
np.isclose(area_test[i, :], area_test[i, 0], rtol=1e-5, atol=1e-5)
587-
)
588-
)
589-
590-
# check that both methods give similar results with 0.01% tolerance in relative difference
591-
self.assertTrue(np.allclose(area, area_test, rtol=1e-2, atol=1e-5))
592-
593568
def test_read_vector_pass(self):
594569
"""Test one columns data"""
595570
shp_file = shapereader.natural_earth(

0 commit comments

Comments
 (0)