Skip to content

Commit b63950a

Browse files
committed
Added nodata attribute to the cultivated data class
1 parent 596c64f commit b63950a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/test_lc_l4_ctv.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def image_groups(l34, urban, cultivated, woody, pv_pc_50):
4141
"cultivated_class": xr.DataArray(
4242
da.from_array(cultivated, chunks=(1, -1, -1)),
4343
dims=("spec", "y", "x"),
44+
attrs={"nodata": 255},
4445
),
4546
"woody_cover": xr.DataArray(
4647
da.from_array(woody, chunks=(1, -1, -1)),
@@ -129,14 +130,16 @@ def test_ctv_classes_woody():
129130

130131
stats_l4 = StatsLccsLevel4()
131132
level3 = lc_level3.lc_level3(xx)
133+
132134
lifeform = lc_lifeform.lifeform(xx)
133135
veg_cover = l4_veg_cover.canopyco_veg_con(xx, stats_l4.veg_threshold)
134136

135137
l4_ctv = l4_cultivated.lc_l4_cultivated(
136138
xx.classes_l3_l4, level3, lifeform, veg_cover
137139
)
138-
assert (l4_ctv.compute() == expected_cultivated_classes).all()
139140

141+
assert (l4_ctv.compute() == expected_cultivated_classes).all()
142+
140143

141144
def test_ctv_classes_herbaceous():
142145

0 commit comments

Comments
 (0)