diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 17275e70..6d3f972a 100755 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,21 @@ All notable changes to this project will be documented in this file. We follow the [Semantic Versioning 2.0.0](http://semver.org/) format. +## v4.5.13.6 - 2025-1-10 - [PR#1387](https://github.com/NOAA-OWP/inundation-mapping/pull/1387) + +Fixes two issues in test_cases: +1. An error in `synthesize_test_cases` and `run_test_case` if any directories of the 5 benchmark sources (BLE, NWS, IFC, USGS, or ras2fim) do not exist. This issue was originally discovered and fixed in #1178, but is being elevated to its own PR here. Fixes #1386. +2. Updated `run_test_cases` to accommodate levee and waterbody masking in Alaska. As part of these changes, hardcoded paths were replaced by environment variables. + +### Changes + +- `tools/` + - `run_test_case.py`: Fixed error if missing validation data. Updated masking data to include Alaska. + - `synthesize_test_cases.py`: Fixed error if missing validation data. + +

+ + ## v4.5.13.5 - 2025-01-09 - [PR#1389](https://github.com/NOAA-OWP/inundation-mapping/pull/1389) Updates Python packages to resolve dependency conflicts that were preventing `Dockerfile.dev` to build on Mac. This also resolves two security warnings: https://github.com/NOAA-OWP/inundation-mapping/security/dependabot/51 and https://github.com/NOAA-OWP/inundation-mapping/security/dependabot/52. @@ -12,7 +27,6 @@ Updates Python packages to resolve dependency conflicts that were preventing `Do

- ## v4.5.13.4 - 2024-01-03 - [PR#1382](https://github.com/NOAA-OWP/inundation-mapping/pull/1382) Cleans up Python files within `delineate_hydros_and_produce_HAND.sh` to improve performance, especially memory management, including removing unused imports, deleting object references when objects are no longer needed, and removing GDAL from the `fim_process_unit_wb.sh` step of FIM pipeline. Contributes to #1351 and #1376. diff --git a/tools/run_test_case.py b/tools/run_test_case.py index efb2f22e..4180b89d 100755 --- a/tools/run_test_case.py +++ b/tools/run_test_case.py @@ -54,6 +54,9 @@ def magnitudes(self): def huc_data(self): '''Returns a dict of HUC8, magnitudes, and sites.''' huc_mags = {} + if not os.path.exists(self.validation_data): + return huc_mags + for huc in os.listdir(self.validation_data): if not re.match(r'\d{8}', huc): continue @@ -126,19 +129,30 @@ def __init__(self, test_id, version, archive=True): # Benchmark data path self.benchmark_dir = os.path.join(self.validation_data, self.huc) - # Create list of shapefile paths to use as exclusion areas. - self.mask_dict = { - 'levees': { - 'path': '/data/inputs/nld_vectors/Levee_protected_areas.gpkg', - 'buffer': None, - 'operation': 'exclude', - }, - 'waterbodies': { - 'path': '/data/inputs/nwm_hydrofabric/nwm_lakes.gpkg', - 'buffer': None, - 'operation': 'exclude', - }, - } + if self.huc[:2] == '19': + self.mask_dict = { + 'levees': { + 'path': os.getenv('input_nld_levee_protected_areas_Alaska'), + 'buffer': None, + 'operation': 'exclude', + }, + 'waterbodies': { + # 'path': '/data/inputs/nwm_hydrofabric/nwm_lakes.gpkg', + 'path': os.getenv('input_nwm_lakes_Alaska'), + 'buffer': None, + 'operation': 'exclude', + }, + } + + else: + self.mask_dict = { + 'levees': { + 'path': os.getenv('input_nld_levee_protected_areas'), + 'buffer': None, + 'operation': 'exclude', + }, + 'waterbodies': {'path': os.getenv('input_nwm_lakes'), 'buffer': None, 'operation': 'exclude'}, + } @classmethod def list_all_test_cases(cls, version, archive, benchmark_categories=[]): diff --git a/tools/synthesize_test_cases.py b/tools/synthesize_test_cases.py index ab734bf7..9118f56f 100755 --- a/tools/synthesize_test_cases.py +++ b/tools/synthesize_test_cases.py @@ -115,6 +115,9 @@ def create_master_metrics_csv( # Iterate through 5 benchmark sources for benchmark_source in ['ble', 'nws', 'usgs', 'ifc', 'ras2fim']: benchmark_test_case_dir = os.path.join(TEST_CASES_DIR, benchmark_source + '_test_cases') + if not os.path.exists(benchmark_test_case_dir): + continue + test_cases_list = [d for d in os.listdir(benchmark_test_case_dir) if re.match(r'\d{8}_\w{3,7}', d)] if benchmark_source in ['ble', 'ifc', 'ras2fim']: