From b7eb578bb98082d8d5fe4c27fb1106a25b50f2cc Mon Sep 17 00:00:00 2001 From: Julia Haas Date: Tue, 2 Jan 2024 16:30:44 +0100 Subject: [PATCH] linting --- .../r.extract.greenroofs.worker.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py index 4890dab..474d4e6 100644 --- a/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py +++ b/grass-gis-addons/m.analyse.buildings/r.extract.greenroofs.worker/r.extract.greenroofs.worker.py @@ -352,7 +352,9 @@ def main(): ) grass.run_command("r.mapcalc", expression=extract_exp, quiet=True) - pot_veg_rast_range = grass.parse_command("r.info", map=pot_veg_rast, flags="r") + pot_veg_rast_range = grass.parse_command( + "r.info", map=pot_veg_rast, flags="r" + ) if pot_veg_rast_range["min"] == pot_veg_rast_range["max"] == "NULL": print( f"r.extract.greenroofs.worker skipped for buildings in tile {num}:" @@ -553,17 +555,23 @@ def main(): # vegetation elements) res_list = [] veg_list = [] - unique_bu_cats = list(set([item["building_cat"] for item in building_dicts])) + unique_bu_cats = list( + set([item["building_cat"] for item in building_dicts]) + ) for building_cat in unique_bu_cats: unique_segs = [ - item for item in building_dicts if item["building_cat"] == building_cat + item + for item in building_dicts + if item["building_cat"] == building_cat ] bu_rest_size = unique_segs[0]["bu_rest_size"] total_veg_size = sum([item["seg_size"] for item in unique_segs]) seg_cats = [item["seg_cat"] for item in unique_segs] proportion = total_veg_size / (bu_rest_size + total_veg_size) * 100 if proportion >= min_veg_proportion: - res_list.append({"building_cat": building_cat, "proportion": proportion}) + res_list.append( + {"building_cat": building_cat, "proportion": proportion} + ) veg_list.extend(seg_cats) if len(veg_list) > 0: