Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 20, 2025
1 parent c694cfd commit 8471506
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(f\"total time to process: {time.time()-start_time}\")"
"print(f\"total time to process: {time.time() - start_time}\")"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
"\n",
" # calculate detour index (circle / shape)...\n",
" detourIndex = p / hullPerim\n",
" metrics[\"DispersionIndex\" \"DispersionIndex\"] = detourIndex\n",
" metrics[\"DispersionIndexDispersionIndex\"] = detourIndex\n",
"\n",
" # Range index\n",
" # custom tool identifies perimeter points that are farthest apart, outputs\n",
Expand Down Expand Up @@ -448,7 +448,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(f\"total time to process: {time.time()-start_time}\")"
"print(f\"total time to process: {time.time() - start_time}\")"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(f\"total time to process: {time.time()-start_time}\")"
"print(f\"total time to process: {time.time() - start_time}\")"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
"metadata": {},
"outputs": [],
"source": [
"print(f\"total time to process: {time.time()-start_time}\")"
"print(f\"total time to process: {time.time() - start_time}\")"
]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@
" cur_smod = (smod == val).astype(int)\n",
" cur_pop = pop * cur_smod\n",
" total_curpop = cur_pop.sum()\n",
" print(f\"{val}: {(total_curpop.sum()/total_pop*100)}\")"
" print(f\"{val}: {(total_curpop.sum() / total_pop * 100)}\")"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"outputs": [],
"source": [
"for ind in selected_indicators:\n",
" print(f'{ind}: {wb.series.info(ind).items[0][\"value\"]}')"
" print(f\"{ind}: {wb.series.info(ind).items[0]['value']}\")"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ def check_no_data(in_folder):
cur_file = os.path.join(root, f)
curR = rasterio.open(cur_file)
curD = curR.read()
print(f'{f}: {(curD == curR.meta["nodata"]).sum()}')
print(f"{f}: {(curD == curR.meta['nodata']).sum()}")


def pp_point_urban_summaries(inD, urban_tiffs, out_file):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"admin0_file = os.path.join(in_folder, \"ZAF_select_adm0.shp\")\n",
"admin3_file = os.path.join(in_folder, \"ADMIN\", \"admin3_geoBounds_FINAL.shp\")\n",
"ghsl_thresh = 0.1\n",
"local_ghsl_file = os.path.join(in_folder, f\"ghsl_combined_{int(ghsl_thresh*100)}.tif\")\n",
"local_ghsl_file = os.path.join(in_folder, f\"ghsl_combined_{int(ghsl_thresh * 100)}.tif\")\n",
"urban_raster = os.path.join(urban_folder, \"zaf1k_cpo20_urban.tif\")\n",
"urban_raster_pop = os.path.join(urban_folder, \"zaf1k_cpo20.tif\")\n",
"urban_extents_file = os.path.join(urban_folder, \"cpo20_urban_extents.shp\")\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"admin1_file = os.path.join(in_folder, \"admin1_geoBounds.shp\")\n",
"admin3_file = os.path.join(in_folder, \"ADMIN\", \"admin3_geoBounds_FINAL.shp\")\n",
"ghsl_thresh = 0.1\n",
"local_ghsl_file = os.path.join(in_folder, f\"ghsl_combined_{int(ghsl_thresh*100)}.tif\")\n",
"local_ghsl_file = os.path.join(in_folder, f\"ghsl_combined_{int(ghsl_thresh * 100)}.tif\")\n",
"high_res_pop = (\n",
" \"/home/public/Data/GLOBAL/Population/RF_SSA_2015-2020/ZAF/ppp_ZAF_const_2020.tif\"\n",
")\n",
Expand Down
2 changes: 1 addition & 1 deletion src/GOSTurban/urban_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def evaluateOutput(self, admin_stats, commune_stats):
f"{name}: TotalPop: {tPop.round(0)}, UrbanPop: {urbPop.round(0)}, HD Pop: {hdPop.round(0)}\n"
)
out_stats.write(
f"{name}: {((urbPop/tPop) * 100).round(2)}% Urban; {((hdPop/tPop) * 100).round(2)}% HD Urban\n"
f"{name}: {((urbPop / tPop) * 100).round(2)}% Urban; {((hdPop / tPop) * 100).round(2)}% HD Urban\n"
)
except:
print(f"Error processing {name}")
Expand Down

0 comments on commit 8471506

Please sign in to comment.