Skip to content

Commit

Permalink
Bug fixes for the Alpha Test to run in FIM 4
Browse files Browse the repository at this point in the history
See Changelog 4.0.3.1 for full details. This addressed #551.
  • Loading branch information
CarsonPruitt-NOAA authored Mar 10, 2022
1 parent b11f981 commit f8eb1e0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
12 changes: 12 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
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.0.3.1 - 2022-03-10 - [PR #561](https://github.com/NOAA-OWP/inundation-mapping/pull/561)

Bug fixes to get the Alpha Test working in FIM 4.

## Changes

- `tools/sythesize_test_cases.py`: Fixed bugs that prevented multiple benchmark types in the same huc from running `run_test_case.py`.
- `tools/run_test_case.py`: Fixed mall bug for IFC benchmark.
- `tools/eval_plots.py`: Fixed Pandas query bugs.

<br/><br/>

## v4.0.3.0 - 2022-03-03 - [PR #550](https://github.com/NOAA-OWP/inundation-mapping/pull/550)

This PR ports the functionality of `usgs_gage_crosswalk.py` and `rating_curve_comparison.py` to FIM 4.
Expand Down
4 changes: 2 additions & 2 deletions tools/eval_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def eval_plots(metrics_csv, workspace, versions = [], stats = ['CSI','FAR','TPR'
# If versions are supplied then filter out
if versions:
#Filter out versions based on supplied version list
metrics = csv_df.query('version.str.startswith(tuple(@versions))')
metrics = csv_df.query('version.str.startswith(tuple(@versions))', engine='python')
else:
metrics = csv_df

Expand All @@ -481,7 +481,7 @@ def eval_plots(metrics_csv, workspace, versions = [], stats = ['CSI','FAR','TPR'
base_resolution = 'nws_lid'

# Filter the dataset based on query (IMPORTED FROM TOOLS_SHARED_VARIABLES.py)
ahps_metrics = benchmark_metrics.query(DISCARD_AHPS_QUERY)
ahps_metrics = benchmark_metrics.query(DISCARD_AHPS_QUERY, engine='python')

# Filter out all instances where the base_resolution doesn't exist across all desired fim versions for a given magnitude
all_datasets[(benchmark_source, extent_configuration)] = filter_dataframe(ahps_metrics, base_resolution)
Expand Down
2 changes: 1 addition & 1 deletion tools/run_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def __vprint(message,verbose):
args['magnitude'] = BLE_MAGNITUDE_LIST
elif ('nws' == benchmark_category) | ('usgs' == benchmark_category):
args['magnitude'] = ['action', 'minor', 'moderate', 'major']
elif 'ifc' == current_benchmark_category:
elif 'ifc' == benchmark_category:
args['magnitude'] = IFC_MAGNITUDE_LIST
else:
print(TRED_BOLD + "Error: " + WHITE_BOLD + "The provided magnitude (-y) " + CYAN_BOLD + args['magnitude'] + WHITE_BOLD + " is invalid. ble options include: 100yr, 500yr. ahps options include action, minor, moderate, major." + ENDC)
Expand Down
5 changes: 3 additions & 2 deletions tools/synthesize_test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def create_master_metrics_csv(master_metrics_csv_output, dev_versions_to_include
versions_to_aggregate = os.listdir(PREVIOUS_FIM_DIR)
if iteration == "comparison":
versions_to_crawl = os.path.join(benchmark_test_case_dir, test_case, 'testing_versions')
versions_to_aggregate = dev_versions_to_include_list

for magnitude in ['action', 'minor', 'moderate', 'major']:
for version in versions_to_aggregate:
Expand Down Expand Up @@ -357,7 +358,7 @@ def create_master_metrics_csv(master_metrics_csv_output, dev_versions_to_include
'gms_verbose': False
}

procs_dict[current_huc] = alpha_test_args
procs_dict[test_id] = alpha_test_args

if job_number_huc == 1:

Expand Down Expand Up @@ -414,4 +415,4 @@ def create_master_metrics_csv(master_metrics_csv_output, dev_versions_to_include
print("Creating master metrics CSV...")

# this function is not compatible with GMS
create_master_metrics_csv(master_metrics_csv_output=master_metrics_csv, versions_to_include_list=dev_versions_to_include_list)
create_master_metrics_csv(master_metrics_csv_output=master_metrics_csv, dev_versions_to_include_list=dev_versions_to_include_list)

0 comments on commit f8eb1e0

Please sign in to comment.