Skip to content

Commit 2f71505

Browse files
KMarkertXee authors
authored andcommitted
Update tests to Landsat Collection 2
Simply changes the Landsat image collections used in the tests from Collection 1 which are deprecated to Collection 2 PiperOrigin-RevId: 626151660
1 parent c5bd12e commit 2f71505

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

xee/ext_integration_test.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ def setUp(self):
6565
super().setUp()
6666
init_ee_for_tests()
6767
self.store = xee.EarthEngineStore(
68-
ee.ImageCollection('LANDSAT/LC08/C01/T1').filterDate(
68+
ee.ImageCollection('LANDSAT/LC08/C02/T1').filterDate(
6969
'2017-01-01', '2017-01-03'
7070
),
7171
n_images=64,
7272
getitem_kwargs={'max_retries': 10, 'initial_delay': 1500},
7373
)
7474
self.store_with_neg_mask_value = xee.EarthEngineStore(
75-
ee.ImageCollection('LANDSAT/LC08/C01/T1').filterDate(
75+
ee.ImageCollection('LANDSAT/LC08/C02/T1').filterDate(
7676
'2017-01-01', '2017-01-03'
7777
),
7878
n_images=64,
@@ -91,7 +91,7 @@ def setUp(self):
9191
getitem_kwargs={'max_retries': 9},
9292
)
9393
self.all_img_store = xee.EarthEngineStore(
94-
ee.ImageCollection('LANDSAT/LC08/C01/T1').filterDate(
94+
ee.ImageCollection('LANDSAT/LC08/C02/T1').filterDate(
9595
'2017-01-01', '2017-01-03'
9696
)
9797
)
@@ -271,7 +271,7 @@ def __getitem__(self, params):
271271

272272
def test_geometry_bounds_with_and_without_projection(self):
273273
image = (
274-
ee.ImageCollection('LANDSAT/LC08/C01/T1')
274+
ee.ImageCollection('LANDSAT/LC08/C02/T1')
275275
.filterDate('2017-01-01', '2017-01-03')
276276
.first()
277277
)
@@ -317,16 +317,16 @@ def setUp(self):
317317
self.entry = xee.EarthEngineBackendEntrypoint()
318318

319319
def test_guess_can_open__collection_name(self):
320-
self.assertTrue(self.entry.guess_can_open('LANDSAT/LC08/C01/T1'))
320+
self.assertTrue(self.entry.guess_can_open('LANDSAT/LC08/C02/T1'))
321321
self.assertFalse(
322322
self.entry.guess_can_open('LANDSAT/SomeRandomCollection/C01/T1')
323323
)
324-
self.assertTrue(self.entry.guess_can_open('ee://LANDSAT/LC08/C01/T1'))
325-
self.assertTrue(self.entry.guess_can_open('ee:LANDSAT/LC08/C01/T1'))
326-
self.assertFalse(self.entry.guess_can_open('ee::LANDSAT/LC08/C01/T1'))
324+
self.assertTrue(self.entry.guess_can_open('ee://LANDSAT/LC08/C02/T1'))
325+
self.assertTrue(self.entry.guess_can_open('ee:LANDSAT/LC08/C02/T1'))
326+
self.assertFalse(self.entry.guess_can_open('ee::LANDSAT/LC08/C02/T1'))
327327

328328
def test_guess_can_open__image_collection(self):
329-
ic = ee.ImageCollection('LANDSAT/LC08/C01/T1').filterDate(
329+
ic = ee.ImageCollection('LANDSAT/LC08/C02/T1').filterDate(
330330
'2017-01-01', '2017-01-03'
331331
)
332332

@@ -372,7 +372,7 @@ def test_open_dataset__sanity_check_with_negative_scale(self):
372372

373373
def test_open_dataset__n_images(self):
374374
ds = self.entry.open_dataset(
375-
pathlib.Path('LANDSAT') / 'LC08' / 'C01' / 'T1',
375+
pathlib.Path('LANDSAT') / 'LC08' / 'C02' / 'T1',
376376
drop_variables=tuple(f'B{i}' for i in range(3, 12)),
377377
n_images=1,
378378
scale=25.0, # in degrees
@@ -469,14 +469,14 @@ def test_expected_precise_transform(self):
469469

470470
def test_parses_ee_url(self):
471471
ds = self.entry.open_dataset(
472-
'ee://LANDSAT/LC08/C01/T1',
472+
'ee://LANDSAT/LC08/C02/T1',
473473
drop_variables=tuple(f'B{i}' for i in range(3, 12)),
474474
scale=25.0, # in degrees
475475
n_images=3,
476476
)
477477
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 14, 'lat': 7})
478478
ds = self.entry.open_dataset(
479-
'ee:LANDSAT/LC08/C01/T1',
479+
'ee:LANDSAT/LC08/C02/T1',
480480
drop_variables=tuple(f'B{i}' for i in range(3, 12)),
481481
scale=25.0, # in degrees
482482
n_images=3,
@@ -498,7 +498,7 @@ def test_data_sanity_check(self):
498498

499499
def test_validate_band_attrs(self):
500500
ds = self.entry.open_dataset(
501-
'ee:LANDSAT/LC08/C01/T1',
501+
'ee:LANDSAT/LC08/C02/T1',
502502
drop_variables=tuple(f'B{i}' for i in range(3, 12)),
503503
scale=25.0, # in degrees
504504
n_images=3,

0 commit comments

Comments
 (0)