Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration test warnings re: Dataset.dims #188

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions xee/ext_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def test_open_dataset__sanity_check(self):
n_images=3,
projection=ee.Projection('EPSG:4326', [25, 0, 0, 0, -25, 0]),
)
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 14, 'lat': 7})
self.assertEqual(dict(ds.sizes), {'time': 3, 'lon': 14, 'lat': 7})
self.assertNotEmpty(dict(ds.coords))
self.assertEqual(
list(ds.data_vars.keys()),
Expand All @@ -360,7 +360,7 @@ def test_open_dataset__sanity_check_with_negative_scale(self):
scale=-25.0, # in degrees
n_images=3,
)
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 14, 'lat': 7})
self.assertEqual(dict(ds.sizes), {'time': 3, 'lon': 14, 'lat': 7})
self.assertNotEmpty(dict(ds.coords))
self.assertEqual(
list(ds.data_vars.keys()),
Expand Down Expand Up @@ -410,8 +410,8 @@ def test_honors_geometry(self):
engine=xee.EarthEngineBackendEntrypoint,
)

self.assertEqual(ds.dims, {'time': 4248, 'lon': 40, 'lat': 35})
self.assertNotEqual(ds.dims, standard_ds.dims)
self.assertEqual(ds.sizes, {'time': 4248, 'lon': 40, 'lat': 35})
self.assertNotEqual(ds.sizes, standard_ds.sizes)

def test_honors_projection(self):
ic = ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY').filterDate(
Expand All @@ -427,8 +427,8 @@ def test_honors_projection(self):
engine=xee.EarthEngineBackendEntrypoint,
)

self.assertEqual(ds.dims, {'time': 4248, 'lon': 3600, 'lat': 1800})
self.assertNotEqual(ds.dims, standard_ds.dims)
self.assertEqual(ds.sizes, {'time': 4248, 'lon': 3600, 'lat': 1800})
self.assertNotEqual(ds.sizes, standard_ds.sizes)

@absltest.skipIf(_SKIP_RASTERIO_TESTS, 'rioxarray module not loaded')
def test_expected_precise_transform(self):
Expand Down Expand Up @@ -476,14 +476,14 @@ def test_parses_ee_url(self):
scale=25.0, # in degrees
n_images=3,
)
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 14, 'lat': 7})
self.assertEqual(dict(ds.sizes), {'time': 3, 'lon': 14, 'lat': 7})
ds = self.entry.open_dataset(
'ee:LANDSAT/LC08/C02/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': 14, 'lat': 7})
self.assertEqual(dict(ds.sizes), {'time': 3, 'lon': 14, 'lat': 7})

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