Skip to content

Commit

Permalink
Handle the cHazard → cHazard_beta rename in OpenDRR/seismic-risk-model
Browse files Browse the repository at this point in the history
Handle the cHazard → cHazard_beta (as well as cDamage → cDamage_beta
even if disabled) rename in OpenDRR/seismic-risk-model
since 2023-05-29 (master) and 2023-09-12 (v1.1.0);
see OpenDRR/seismic-risk-model#92

Fixes #245
  • Loading branch information
anthonyfok committed Apr 2, 2024
1 parent 14de9d8 commit 579057c
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions python/add_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -574,18 +574,32 @@ import_raw_psra_tables() {
# TODO: Compare PT_LIST with FETCHED_PT_LIST
RUN mapfile -t FETCHED_PT_LIST < <(jq -r '.[].name' output.json)

# LOG "### cDamage"
# RUN fetch_psra_csv_from_model cDamage

# Disable cDamage. As @wkhchow noted in commit 922c409:
# change cDamage reference to eDamage (cDamage will be removed eventually)
# See also https://github.com/OpenDRR/opendrr-api/pull/201 (May 2022)
#
# LOG "### cDamage_beta"
# INFO "cDamage was renamed to cDamage_beta as it is not part of the official release"
# INFO "See https://github.com/OpenDRR/seismic-risk-model/pull/92"
# RUN fetch_psra_csv_from_model cDamage_beta
# LOG "Rename cDamage_beta back to cDamage"
# RUN rm -rf cDamage
# RUN mv -v cDamage_beta cDamage
#
# for PT in "${PT_LIST[@]}"; do
# ( cd "cDamage/$PT"
# RUN merge_csv cD_*dmg-mean_b0.csv "cD_${PT}_dmg-mean_b0.csv"
# RUN merge_csv cD_*dmg-mean_r2.csv "cD_${PT}_dmg-mean_r2.csv"
# )
# done

LOG "### cHazard"
RUN fetch_psra_csv_from_model cHazard
LOG "### cHazard_beta"
INFO "cHazard was renamed to cHazard_beta as it is not part of the official release"
INFO "See https://github.com/OpenDRR/seismic-risk-model/pull/92"
RUN fetch_psra_csv_from_model cHazard_beta
LOG "Rename cHazard_beta back to cHazard"
RUN rm -rf cHazard
RUN mv -v cHazard_beta cHazard

# This was only needed when the cHazard data was divided by economic region
# for PT in "${PT_LIST[@]}"; do
Expand Down

0 comments on commit 579057c

Please sign in to comment.