fimeval 0.1.47__tar.gz → 0.1.48__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fimeval-0.1.47 → fimeval-0.1.48}/PKG-INFO +1 -1
- {fimeval-0.1.47 → fimeval-0.1.48}/pyproject.toml +1 -1
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/ContingencyMap/evaluationFIM.py +16 -8
- {fimeval-0.1.47 → fimeval-0.1.48}/LICENSE.txt +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/README.md +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/BuildingFootprint/__init__.py +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/BuildingFootprint/evaluationwithBF.py +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/ContingencyMap/PWBs3.py +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/ContingencyMap/__init__.py +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/ContingencyMap/methods.py +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/ContingencyMap/metrics.py +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/ContingencyMap/plotevaluationmetrics.py +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/ContingencyMap/printcontingency.py +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/__init__.py +0 -0
- {fimeval-0.1.47 → fimeval-0.1.48}/src/fimeval/utilis.py +0 -0
|
@@ -333,7 +333,16 @@ def evaluateFIM(
|
|
|
333
333
|
print(f"Evaluation metrics saved to {csv_file}")
|
|
334
334
|
return results
|
|
335
335
|
|
|
336
|
-
|
|
336
|
+
#Safely deleting the folder
|
|
337
|
+
def safe_delete_folder(folder_path):
|
|
338
|
+
try:
|
|
339
|
+
shutil.rmtree(folder_path)
|
|
340
|
+
except PermissionError:
|
|
341
|
+
print(f"Permission denied: Could not delete {folder_path}")
|
|
342
|
+
except FileNotFoundError:
|
|
343
|
+
print(f"Folder not found: {folder_path}")
|
|
344
|
+
except Exception as e:
|
|
345
|
+
print(f"Error deleting {folder_path}: {e}")
|
|
337
346
|
|
|
338
347
|
def EvaluateFIM(main_dir, method_name, output_dir, PWB_dir=None, shapefile_dir=None, target_crs=None, target_resolution=None):
|
|
339
348
|
main_dir = Path(main_dir)
|
|
@@ -384,12 +393,12 @@ def EvaluateFIM(main_dir, method_name, output_dir, PWB_dir=None, shapefile_dir=N
|
|
|
384
393
|
if TIFFfiles_main_dir:
|
|
385
394
|
MakeFIMsUniform(main_dir, target_crs=target_crs, target_resolution=target_resolution)
|
|
386
395
|
|
|
387
|
-
#processing folder
|
|
396
|
+
# processing folder
|
|
388
397
|
processing_folder = main_dir / "processing"
|
|
389
398
|
TIFFfiles = list(processing_folder.glob("*.tif"))
|
|
390
399
|
|
|
391
400
|
process_TIFF(TIFFfiles, main_dir)
|
|
392
|
-
|
|
401
|
+
safe_delete_folder(processing_folder)
|
|
393
402
|
else:
|
|
394
403
|
for folder in main_dir.iterdir():
|
|
395
404
|
if folder.is_dir():
|
|
@@ -397,13 +406,12 @@ def EvaluateFIM(main_dir, method_name, output_dir, PWB_dir=None, shapefile_dir=N
|
|
|
397
406
|
|
|
398
407
|
if tif_files:
|
|
399
408
|
MakeFIMsUniform(folder, target_crs=target_crs, target_resolution=target_resolution)
|
|
400
|
-
|
|
409
|
+
|
|
401
410
|
processing_folder = folder / "processing"
|
|
402
411
|
TIFFfiles = list(processing_folder.glob("*.tif"))
|
|
403
412
|
|
|
404
413
|
process_TIFF(TIFFfiles, folder)
|
|
405
|
-
|
|
414
|
+
safe_delete_folder(processing_folder)
|
|
406
415
|
else:
|
|
407
|
-
print(
|
|
408
|
-
|
|
409
|
-
)
|
|
416
|
+
print(f"Skipping {folder.name} as it doesn't contain any tif files.")
|
|
417
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|