diff --git a/odc/stats/plugins/l34_utils/l4_cultivated.py b/odc/stats/plugins/l34_utils/l4_cultivated.py index 8ae8f8c3..82b0e69c 100644 --- a/odc/stats/plugins/l34_utils/l4_cultivated.py +++ b/odc/stats/plugins/l34_utils/l4_cultivated.py @@ -4,7 +4,7 @@ def lc_l4_cultivated(l34, level3, woody, veg_cover): - + woody = expr_eval( "where((a!=a), nodata, a)", {"a": woody.data}, @@ -13,7 +13,7 @@ def lc_l4_cultivated(l34, level3, woody, veg_cover): **{"nodata": NODATA}, ) - # the 4-8 classes can't happen in LC since cultivated class will not be classified if vegetation doesn't exist. + # the 4-8 classes can't happen in LC since cultivated class will not be classified if vegetation doesn't exist. # skip these classes in level4 l4 = expr_eval( "where((a==111), 1, d)", @@ -42,7 +42,7 @@ def lc_l4_cultivated(l34, level3, woody, veg_cover): name="mark_cultivated", dtype="uint8", ) - + l4 = expr_eval( "where((a==111)&(b==12)&(c==113), 10, d)", {"a": level3, "b": veg_cover, "c": woody, "d": l4}, @@ -101,8 +101,4 @@ def lc_l4_cultivated(l34, level3, woody, veg_cover): dtype="uint8", ) - - - - return l4 diff --git a/odc/stats/plugins/l34_utils/l4_natural_veg.py b/odc/stats/plugins/l34_utils/l4_natural_veg.py index 4b40a5ca..edb92161 100644 --- a/odc/stats/plugins/l34_utils/l4_natural_veg.py +++ b/odc/stats/plugins/l34_utils/l4_natural_veg.py @@ -12,7 +12,7 @@ def lc_l4_natural_veg(l4, l3, woody, veg_cover): dtype="float32", **{"nodata": NODATA}, ) - + l4 = expr_eval( "where((b==nodata), nodata, a)", {"a": l4, "b": l3}, @@ -20,14 +20,14 @@ def lc_l4_natural_veg(l4, l3, woody, veg_cover): dtype="uint8", **{"nodata": NODATA}, ) - + l4 = expr_eval( "where((a==112), 19, d)", {"a": l3, "d": l4}, name="mark_cultivated", dtype="uint8", ) - + l4 = expr_eval( "where((a==112)&(b==113), 20, d)", {"a": l3, "b": woody, "d": l4}, @@ -137,6 +137,4 @@ def lc_l4_natural_veg(l4, l3, woody, veg_cover): dtype="uint8", ) - - return l4 diff --git a/odc/stats/plugins/l34_utils/l4_surface.py b/odc/stats/plugins/l34_utils/l4_surface.py index cb96e0cb..fcf640ba 100644 --- a/odc/stats/plugins/l34_utils/l4_surface.py +++ b/odc/stats/plugins/l34_utils/l4_surface.py @@ -33,5 +33,5 @@ def lc_l4_surface(l4, level3, bare_gradation): name="mark_surface", dtype="uint8", ) - + return l4 diff --git a/odc/stats/plugins/l34_utils/l4_water.py b/odc/stats/plugins/l34_utils/l4_water.py index 478dd4be..8e05c64a 100644 --- a/odc/stats/plugins/l34_utils/l4_water.py +++ b/odc/stats/plugins/l34_utils/l4_water.py @@ -5,7 +5,6 @@ def water_classification(xx, water_persistence): - # Replace nan with nodata l4 = expr_eval( "where((a==a), a, nodata)", @@ -14,7 +13,7 @@ def water_classification(xx, water_persistence): dtype="uint8", **{"nodata": NODATA}, ) - + intertidal_mask = expr_eval( "where(a==_u, 1, 0)", {"a": l4}, diff --git a/tests/test_lc_l4_ctv.py b/tests/test_lc_l4_ctv.py index 6f0035ab..16546d0c 100644 --- a/tests/test_lc_l4_ctv.py +++ b/tests/test_lc_l4_ctv.py @@ -365,8 +365,8 @@ def test_ctv_classes_no_vegcover(): stats_l4 = StatsLccsLevel4() level3 = lc_level3.lc_level3(xx) - + veg_cover = l4_veg_cover.canopyco_veg_con(xx, stats_l4.veg_threshold) l4_ctv = l4_cultivated.lc_l4_cultivated(xx.level_3_4, level3, xx.woody, veg_cover) - + assert (l4_ctv.compute() == expected_cultivated_classes).all() diff --git a/tests/test_lc_l4_water.py b/tests/test_lc_l4_water.py index b612ee50..851e3d75 100644 --- a/tests/test_lc_l4_water.py +++ b/tests/test_lc_l4_water.py @@ -168,9 +168,7 @@ def test_water_classes(): xx, stats_l4.watper_threshold ) - l4_water_classes = l4_water.water_classification( - xx, water_persistence - ) + l4_water_classes = l4_water.water_classification(xx, water_persistence) assert (l4_water_classes.compute() == expected_water_classes).all() @@ -276,8 +274,6 @@ def test_water_intertidal(): xx, stats_l4.watper_threshold ) - l4_water_classes = l4_water.water_classification( - xx, water_persistence - ) + l4_water_classes = l4_water.water_classification(xx, water_persistence) assert (l4_water_classes.compute() == expected_water_classes).all()