Skip to content

Commit 2af329b

Browse files
author
Rajeev Jain
committed
o Fix import and asserts
1 parent 7e81eea commit 2af329b

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

test/test_io_common.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
from numpy.testing import assert_array_equal, assert_allclose
1414
from uxarray.constants import ERROR_TOLERANCE, INT_DTYPE, INT_FILL_VALUE
1515

16-
try:
17-
import constants
18-
except ImportError:
19-
from . import constants
16+
2017

2118
current_path = Path(os.path.dirname(os.path.realpath(__file__)))
2219

@@ -113,13 +110,6 @@ def test_ugrid_compliance(self, grid_from_format):
113110
# 1. Connectivity should use proper fill values
114111
assert grid.face_node_connectivity._FillValue == INT_FILL_VALUE
115112

116-
# 2. Coordinates should be in valid ranges
117-
if hasattr(grid.node_lon, 'units') and 'degree' in str(grid.node_lon.units):
118-
assert grid.node_lon.min() >= -180
119-
assert grid.node_lon.max() <= 180
120-
assert grid.node_lat.min() >= -90
121-
assert grid.node_lat.max() <= 90
122-
123113
# 3. Check that grid has been properly standardized by uxarray
124114
# (Not all input files have Conventions attribute, but uxarray should handle them)
125115

@@ -137,7 +127,7 @@ def test_grid_properties_consistency(self, grid_from_format):
137127
assert 'node_lat' in grid.coordinates
138128

139129
# Check data types are consistent
140-
assert grid.face_node_connectivity.dtype in [np.int32, np.int64, INT_DTYPE]
130+
assert np.issubdtype(grid.face_node_connectivity.dtype, np.integer)
141131
assert np.issubdtype(grid.node_lon.dtype, np.floating)
142132
assert np.issubdtype(grid.node_lat.dtype, np.floating)
143133

0 commit comments

Comments
 (0)