Skip to content

Commit

Permalink
Fix references to deprecated Landsat Collection 1.
Browse files Browse the repository at this point in the history
This fixes broken tests in xee.ext_integration_test.py

The tests were broken because the Landsat collection LANDSAT/LC08/C01/T1 was removed from Earth Engine. PR #157 was supposed to fix this but missed some references to "C01". This replaces all references to "C01" with "C02" which is available in the data catalog.

PiperOrigin-RevId: 656004125
  • Loading branch information
KMarkert authored and Xee authors committed Jul 25, 2024
1 parent 53cb53b commit 88a4fac
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions xee/ext_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def setUp(self):
def test_guess_can_open__collection_name(self):
self.assertTrue(self.entry.guess_can_open('LANDSAT/LC08/C02/T1'))
self.assertFalse(
self.entry.guess_can_open('LANDSAT/SomeRandomCollection/C01/T1')
self.entry.guess_can_open('LANDSAT/SomeRandomCollection/C02/T1')
)
self.assertTrue(self.entry.guess_can_open('ee://LANDSAT/LC08/C02/T1'))
self.assertTrue(self.entry.guess_can_open('ee:LANDSAT/LC08/C02/T1'))
Expand All @@ -336,7 +336,7 @@ def test_guess_can_open__image_collection(self):

def test_open_dataset__sanity_check(self):
ds = self.entry.open_dataset(
pathlib.Path('LANDSAT') / 'LC08' / 'C01' / 'T1',
pathlib.Path('LANDSAT') / 'LC08' / 'C02' / 'T1',
drop_variables=tuple(f'B{i}' for i in range(3, 12)),
n_images=3,
projection=ee.Projection('EPSG:4326', [25, 0, 0, 0, -25, 0]),
Expand All @@ -345,7 +345,8 @@ def test_open_dataset__sanity_check(self):
self.assertNotEmpty(dict(ds.coords))
self.assertEqual(
list(ds.data_vars.keys()),
[f'B{i}' for i in range(1, 3)] + ['BQA'],
[f'B{i}' for i in range(1, 3)]
+ ['QA_PIXEL', 'QA_RADSAT', 'SAA', 'SZA', 'VAA', 'VZA'],
)
for v in ds.values():
self.assertIsNotNone(v.data)
Expand All @@ -354,7 +355,7 @@ def test_open_dataset__sanity_check(self):

def test_open_dataset__sanity_check_with_negative_scale(self):
ds = self.entry.open_dataset(
pathlib.Path('LANDSAT') / 'LC08' / 'C01' / 'T1',
pathlib.Path('LANDSAT') / 'LC08' / 'C02' / 'T1',
drop_variables=tuple(f'B{i}' for i in range(3, 12)),
scale=-25.0, # in degrees
n_images=3,
Expand All @@ -363,7 +364,8 @@ def test_open_dataset__sanity_check_with_negative_scale(self):
self.assertNotEmpty(dict(ds.coords))
self.assertEqual(
list(ds.data_vars.keys()),
[f'B{i}' for i in range(1, 3)] + ['BQA'],
[f'B{i}' for i in range(1, 3)]
+ ['QA_PIXEL', 'QA_RADSAT', 'SAA', 'SZA', 'VAA', 'VZA'],
)
for v in ds.values():
self.assertIsNotNone(v.data)
Expand Down

0 comments on commit 88a4fac

Please sign in to comment.