Skip to content

Commit fca4b43

Browse files
authored
test: fix back the image tests
1 parent 69bb851 commit fca4b43

15 files changed

+29
-24
lines changed

tests/conftest.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,14 @@ def s2_sr_vatican_2020():
122122
@pytest.fixture
123123
def l8_sr_vatican_2020():
124124
"""A single image from 2020 on top of vatican city from L8 SR collection."""
125-
src = "LANDSAT/LC08/C02/T1/LC08_191031_20130711"
125+
src = "LANDSAT/LC08/C02/T1_L2/LC08_191031_20200104"
126+
return ee.Image(src).select(L8_SR_BAND_COMBO)
127+
128+
129+
@pytest.fixture
130+
def l8_toa_vatican_2020():
131+
"""A single image from 2020 on top of vatican city from L8 TOA collection."""
132+
src = "LANDSAT/LC08/C02/T1_TOA/LC08_191031_20200104"
126133
return ee.Image(src).select(L8_BAND_COMBO)
127134

128135

tests/test_Image.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from jsonschema import validate
1414
from matplotlib import pyplot as plt
1515

16+
import geetools # noqa: F401
17+
1618

1719
class TestAddDate:
1820
"""Test the ``addDate`` method."""
@@ -497,11 +499,8 @@ def get_citation(self, s2_sr_vatican_2020, data_regression):
497499
class TestPanSharpen:
498500
"""Test the panSharpen method."""
499501

500-
@pytest.mark.xfail(
501-
reason="This test is failing because the panSharpen method is not implemented for this platform."
502-
)
503-
def test_pan_sharpen(self, l8_sr_vatican_2020, num_regression):
504-
sharp = l8_sr_vatican_2020.geetools.panSharpen(method="HPFA", qa=["MSE", "RMSE"], maxPixels=1e13)
502+
def test_pan_sharpen(self, l8_toa_vatican_2020, num_regression):
503+
sharp = l8_toa_vatican_2020.geetools.panSharpen(method="HPFA", qa=["MSE", "RMSE"], maxPixels=1e13)
505504
centroid = sharp.geometry().centroid().buffer(100)
506505
values = sharp.reduceRegion(ee.Reducer.mean(), centroid, 1)
507506
num_regression.check(values.getInfo())
@@ -510,7 +509,6 @@ def test_pan_sharpen(self, l8_sr_vatican_2020, num_regression):
510509
class TestTasseledCap:
511510
"""Test the tasseledCap method."""
512511

513-
@pytest.mark.xfail("The tasseledCap method is not implemented for this platform (yet).")
514512
def test_tasseled_cap(self, l8_sr_vatican_2020, num_regression):
515513
img = l8_sr_vatican_2020.geetools.tasseledCap()
516514
centroid = img.geometry().centroid().buffer(100)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
,AOT,B1,B11,B12,B2,B3,B4,B5,B6,B7,B8,B8A,B9,CLOUD_MASK,CLOUD_SHADOW_MASK,MSK_CLASSI_CIRRUS,MSK_CLASSI_OPAQUE,MSK_CLASSI_SNOW_ICE,MSK_CLDPRB,MSK_SNWPRB,QA10,QA20,QA60,SCL,SHADOW_MASK,TCI_B,TCI_G,TCI_R,WVP
2-
0,72,238.7171666246534,948.66361230148675,750.75646584320634,320.95785228132081,415.14734055961685,426.16661204940726,604.81486009578975,1007.6004411393997,1140.2466599445429,1217.7626543987888,1200.1272498109399,1389.4672800604985,0.016070078144693717,0,,,,0.27464078648853035,0,0,0,0,3.3245021426770851,0.11822535921351142,33.158558104360964,42.684144189563895,43.699306780942756,681.94626922107386
1+
,B1,B11,B12,B2,B3,B4,B5,B6,B7,B8,B8A,B9,CLOUD_MASK,CLOUD_SHADOW_MASK,SCL,SHADOW_MASK
2+
0,184.91138139652122,757.02859843710587,584.90854550037807,235.32171666246529,316.66567935467583,313.57853541719169,479.29521048651361,848.1934333249302,970.15790269725198,1051.9516007058226,1023.5374716410383,1170.6954499621881,0.016070078144693717,0,4.8100201663725723,0.13090496596924625
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
,B2,B3,B4,B5,B6,B7
2-
0,0.074917420895752956,0.062279983815516041,0.035777563662935274,0.27570176610947872,0.085119200009892163,0.030933266714784642
2+
0,0.13925332450661729,0.083061006450280861,0.047329401610081874,0.021863697489252699,0.0049476349583736055,0.0025551534896570169
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
,AOT,B1,B11,B12,B2,B3,B4,B5,B6,B7,B8,B8A,B9,MSK_CLDPRB,MSK_SNWPRB,QA10,QA20,QA60,SCL,TCI_B,TCI_G,TCI_R,WVP
2-
0,0.072000000000000008,0.023871716662465316,0.094866361230148563,0.075075646584320546,0.032095785228132098,0.041514734055961663,0.042616661204940731,0.06048148600957913,0.10076004411394013,0.11402466599445431,0.12177626543987899,0.1200127249810941,0.13894672800604949,0.27464078648853035,0,0,0,0,3.3245021426770851,33.158558104360964,42.684144189563895,43.699306780942756,0.68194626922107227
1+
,B1,B11,B12,B2,B3,B4,B5,B6,B7,B8,B8A,B9,SCL
2+
0,0.018491138139652124,0.075702859843710585,0.058490854550037837,0.023532171666246542,0.03166656793546762,0.031357853541719181,0.047929521048651308,0.084819343332493011,0.097015790269725288,0.1051951600705822,0.10235374716410368,0.1170695449962183,4.8100201663725723
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
,AOT,B1,B11,B12,B2,B3,B4,B5,B6,B7,B8,B8A,B9,MSK_CLDPRB,MSK_SNWPRB,QA10,QA20,QA60,SCL,TCI_B,TCI_G,TCI_R,WVP
2-
0,0.072000000000000008,0.023871716662465316,0.094866361230148563,0.075075646584320546,0.032095785228132098,0.041514734055961663,0.042616661204940731,0.06048148600957913,0.10076004411394013,0.11402466599445431,0.12177626543987899,0.1200127249810941,0.13894672800604949,0.27464078648853035,0,0,0,0,3.3245021426770851,33.158558104360964,42.684144189563895,43.699306780942756,0.68194626922107227
1+
,B1,B11,B12,B2,B3,B4,B5,B6,B7,B8,B8A,B9,SCL
2+
0,0.018491138139652124,0.075702859843710585,0.058490854550037837,0.023532171666246542,0.03166656793546762,0.031357853541719181,0.047929521048651308,0.084819343332493011,0.097015790269725288,0.1051951600705822,0.10235374716410368,0.1170695449962183,4.8100201663725723
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
,B1,B2,B3,B4,B5,B7,TCB,TCG,TCW
2-
0,80.646786099516518,36.996091045013017,39.201923038041691,41.476289750435498,60.247799617469894,37.873670520610993,107.81693958004151,-23.51120101153365,-7.983038306874465
1+
,SR_B3,SR_B4,SR_B5,SR_B6,SR_B7,TCB,TCG,TCW
2+
0,8265.40462419512,7357.8677692817118,7157.5566455516273,7332.7621417996243,7332.1622826786279,16333.149618926702,-1642.3712522786986,-2874.4131566471274

tests/test_ImageCollection/serialized_test_reduce_interval.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ values:
602602
valueReference: '24'
603603
functionName: String.cat
604604
'4':
605-
constantValue: da1cbb74f3334b598c512e29451dd8e8
605+
constantValue: c5907ad1629a463eb0594f14f42715c2
606606
'5':
607607
functionInvocationValue:
608608
arguments:

tests/test_ImageCollection/serialized_test_reduce_interval_properties.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ values:
602602
valueReference: '24'
603603
functionName: String.cat
604604
'4':
605-
constantValue: 559148b2c5634e518fabdd8b816b1580
605+
constantValue: 718c46451a6f486ead54ee5151b48e26
606606
'5':
607607
functionInvocationValue:
608608
arguments:

tests/test_ImageCollection/serialized_test_reduce_interval_with_multi_output_reducer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ values:
630630
valueReference: '12'
631631
functionName: String.cat
632632
'4':
633-
constantValue: 7e31ed9377544e4daae5de452a856eff
633+
constantValue: 2e019fc0e446496e82b5cbb518a86c61
634634
'5':
635635
functionInvocationValue:
636636
arguments:

0 commit comments

Comments
 (0)