Skip to content

Commit

Permalink
Updating Integration Test Constants.
Browse files Browse the repository at this point in the history
Updating constants as we begin to automate running integration tests.

More attention is needed here to tell if the coordinates are accurate. This will be addressed in #57.

PiperOrigin-RevId: 572278845
  • Loading branch information
Xee authors committed Oct 10, 2023
1 parent 68b503f commit 4a6f7d8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions xee/ext_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ def setUp(self):

def test_creates_lat_long_array(self):
arr = xee.EarthEngineBackendArray('longitude', self.lnglat_store)
self.assertEqual((1, 360, 180), arr.shape)
self.assertEqual((1, 360, 179), arr.shape)

def test_can_create_object(self):
arr = xee.EarthEngineBackendArray('B4', self.store)

self.assertIsNotNone(arr)

self.assertEqual((64, 360, 180), arr.shape)
self.assertEqual((64, 360, 179), arr.shape)
self.assertEqual(np.int32, arr.dtype)
self.assertEqual('B4', arr.variable_name)

Expand Down Expand Up @@ -258,7 +258,7 @@ def test_open_dataset__sanity_check(self):
n_images=3,
)
self.assertEqual(
dict(ds.dims), {'time': 3, 'lon': 15, 'lat': 8}
dict(ds.dims), {'time': 3, 'lon': 15, 'lat': 7}
)
self.assertNotEmpty(dict(ds.coords))
self.assertEqual(
Expand All @@ -268,7 +268,7 @@ def test_open_dataset__sanity_check(self):
for v in ds.values():
self.assertIsNotNone(v.data)
self.assertFalse(v.isnull().all(), 'All values are null!')
self.assertEqual(v.shape, (3, 15, 8))
self.assertEqual(v.shape, (3, 15, 7))

def test_open_dataset__n_images(self):
ds = self.entry.open_dataset(
Expand Down Expand Up @@ -308,7 +308,7 @@ def test_honors_geometry(self):
engine=xee.EarthEngineBackendEntrypoint,
)

self.assertEqual(ds.dims, {'time': 4248, 'lon': 42, 'lat': 36})
self.assertEqual(ds.dims, {'time': 4248, 'lon': 42, 'lat': 34})
self.assertNotEqual(ds.dims, standard_ds.dims)

def test_honors_projection(self):
Expand All @@ -335,14 +335,14 @@ def test_parses_ee_url(self):
scale=25.0, # in degrees
n_images=3,
)
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 15, 'lat': 8})
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 15, 'lat': 7})
ds = self.entry.open_dataset(
'ee:LANDSAT/LC08/C01/T1',
drop_variables=tuple(f'B{i}' for i in range(3, 12)),
scale=25.0, # in degrees
n_images=3,
)
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 15, 'lat': 8})
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 15, 'lat': 7})

def test_data_sanity_check(self):
# This simple test uncovered a bug with the default definition of `scale`.
Expand Down

0 comments on commit 4a6f7d8

Please sign in to comment.