Skip to content

Commit 59165b5

Browse files
committed
fix: fix output rasters stdout message for wofe calculate weights CLI function
1 parent 4b049f7 commit 59165b5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

eis_toolkit/cli.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -3132,16 +3132,21 @@ def weights_of_evidence_calculate_weights_cli(
31323132

31333133
df.to_csv(output_dir.joinpath("wofe_results.csv"))
31343134

3135+
out_rasters_dict = {}
31353136
file_name = input_raster.name.split(".")[0]
31363137
for key, array in arrays.items():
3137-
output_raster_path = output_dir.joinpath(file_name + "_weights_" + weights_type + "_" + key + ".tif")
3138+
output_raster_name = file_name + "_weights_" + weights_type + "_" + key
3139+
output_raster_path = output_dir.joinpath(output_raster_name + ".tif")
31383140
with rasterio.open(output_raster_path, "w", **raster_meta) as dst:
31393141
dst.write(array, 1)
3142+
out_rasters_dict[output_raster_name] = str(output_raster_path)
31403143

3144+
json_str = json.dumps(out_rasters_dict)
31413145
typer.echo("Progress 100%")
31423146

31433147
typer.echo(f"Number of deposit pixels: {nr_of_deposits}")
31443148
typer.echo(f"Number of all evidence pixels: {nr_of_pixels}")
3149+
typer.echo(f"Output rasters: {json_str}")
31453150
typer.echo(f"Weight calculations completed, rasters and CSV saved to {output_dir}.")
31463151

31473152

0 commit comments

Comments
 (0)