Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename three of the existing DSRA scenarios #77

Merged
merged 15 commits into from
Apr 18, 2023
Merged

Conversation

anthonyfok
Copy link
Member

@anthonyfok anthonyfok commented Mar 2, 2023

This pull request aims to rename the following three existing DSRA scenarios in the repository:

  • ACM4p9_Capilano5 → ACM4p9_GeorgiaStraitFault
  • ACM7p4_BurwashLanding → ACM7p4_DenaliFault
  • SCM5p5_Ottawa → SCM5p5_ConstanceBay

for better accuracy and consistency with RiskProfiler.ca. The source initialization files *.ini, rupture models *.xml and "FINISHED" CSV data *.csv are renamed where necessary, and the PNG map files and Markdown files regenerated.

Some minor tweaks were also made to the Bash and Python scripts as well as to the scenario descriptions.

Partially fixes the following issues:

Many thanks!

[Update] Missing French descriptions for the following recently added scenarios have been added, courtesy of DeepL Translator, in commit 03f0ab1:

  • ACM4p9_GeorgiaStraitFault
  • SCM5p0_Montreal
  • SCM5p5_ConstanceBay

AFAIK, all the scenario descriptions were translated with DeepL. We probably need real French speakers to review the translations some day. Also, I wonder if the title (e.g. M4.9 Georgia Strait Fault) should eventually be translated too?

This was done manually so as to see the results right away (before I
fully understand the whole pipeflow) and to allow for some finer edits
which would require enhancing the source data and related Python scripts
to fully support.
The following DSRA scenarios are renamed for better accuracy:

- ACM4p9_Capilano5 -> ACM4p9_GeorgiaStraitFault
- ACM7p4_BurwashLanding -> ACM7p4_DenaliFault
- SCM5p5_Ottawa -> SCM5p5_ConstanceBay

Besides changing the file names of the relevant FINISHED/*.csv,
initializations/*.ini and ruptures/*.xml, some of the
initializations files are modified to point to the
correct/renamed rupture model files.
Run Python Black (with -S, --skip-string-normalization) to unify Python
code formatting, and fix some of the issues reported by Pylint,
on the scripts TakeSnapshot.py, finishedMap.py and generate_yml.py.

Simplify some string definitions with "formatted string literals"
(f-strings).

Fix ShellCheck issues on finishedMap.sh, and adjust formatting.

Add SPDX-License-Identifier, brief copyright notices and authors
where applicable.
- Replace "http://" in URLs with secure "https://"
- Rename "configParser" variable to simply "config"
  as per https://docs.python.org/3/library/configparser.html
- Ensure GeoJSON and Markdown files have a linefeed at the end of file
- TakeSnapshot.py: Fix Usage in comment: change HAZ to SHAKE
- generate_yml.py:
  + Replace "Val Des Bois" with "Val-des-Bois"
  + Change titles from e.g. "Sidney - Magnitude 7.1" to "M7.1 Sidney"
- ACM4p9_Capilano5 -> ACM4p9_GeorgiaStraitFault
- ACM7p4_BurwashLanding -> ACM7p4_DenaliFault
- SCM5p5_Ottawa -> SCM5p5_ConstanceBay

The following commands were used to generate the .md and .png files:

    ../scripts/TakeSnapshot.py ACM4p9_GeorgiaStraitFault b 1 2 3 4 5
    ../scripts/TakeSnapshot.py ACM7p4_DenaliFault b 181 182 183 184 185
    ../scripts/TakeSnapshot.py SCM5p5_ConstanceBay b 118 119 120 121 122
@anthonyfok anthonyfok added Bug Something isn't working Enhancement New feature or request labels Mar 2, 2023
- ACM4p9_Capilano5 -> ACM4p9_GeorgiaStraitFault
- ACM7p4_BurwashLanding -> ACM7p4_DenaliFault
- SCM5p5_Ottawa -> SCM5p5_ConstanceBay

The following command was used to remove the obsolete files:

    git rm ACM4p9_Capilano5.* ACM7p4_BurwashLanding.* SCM5p5_Ottawa.*

Without their removal, finishedMap.sh would fail as follows:

    $ ../scripts/finishedMap.sh
    Traceback (most recent call last):
      File "OpenDRR/earthquake-scenarios/FINISHED/../scripts/generate_yml.py", line 35, in <module>
        config.read_file(open(f'../initializations/s_Hazard_{name}.ini'))
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: '../initializations/s_Hazard_ACM4p9_Capilano5.ini'
which updates FinishedScenarios{,Fr}.geojson,
FinishedScenarios.md and scenarios.csv files.

The changes in the automatically generated docs/_data/dsra.yml are
discarded for now and not included in this commit.
- ACM4p9_GeorgiaStraitFault
- SCM5p0_Montreal
- SCM5p5_ConstanceBay

The descriptions were translated using DeepL Translator (deepl.com)
with the following adjustments:

- Quotation marks are replaced with guillemets « »
- U+202F   NARROW NO-BREAK SPACE (NNBSP) (espace fine insécable)
  are used before %, », and after «.
- Typewriter apostrophes (') are replaced with typographic apostrophes (’)
@drotheram
Copy link

@tieganh Please review when able

@DamonU2
Copy link
Collaborator

DamonU2 commented Mar 6, 2023

Going to need changes to dsra_scenario_map.md in /docs/_pages/en and /fr starting at line 449. I wasn't able to automate that part of the GitHub pages. Also, there's probably enough scenarios there to bring back the map that is currently commented out in the index.md (/en and /fr) files starting at line 73 (which also needs an edit to the link from my fork to the main repo).

Special thanks to Damon Ulmi (@DamonU2) who reminded us that changes are
needed to to dsra_scenario_map.md in docs/_pages/{en,fr} starting at line 449
so that the correct areas are displayed on the maps.

Part of the series of commits for the rename of the following scenarios:

- ACM4p9_Capilano5 -> ACM4p9_GeorgiaStraitFault
- ACM7p4_BurwashLanding -> ACM7p4_DenaliFault
- SCM5p5_Ottawa -> SCM5p5_ConstanceBay
@wkhchow
Copy link
Collaborator

wkhchow commented Mar 13, 2023

Can we also remove the old scenario geopackages, and replace them with the new ones for 'completeness'?
I have the new scenarios generated and can provide you the link. @anthonyfok

Part of the series of commits for the rename of the following scenarios:

- ACM4p9_Capilano5 -> ACM4p9_GeorgiaStraitFault
- ACM7p4_BurwashLanding -> ACM7p4_DenaliFault
- SCM5p5_Ottawa -> SCM5p5_ConstanceBay

Special thanks to William Chow (@wkhchow) for regenerating these
GeoPackage files and for reminding me to upload them!
@anthonyfok
Copy link
Member Author

Can we also remove the old scenario geopackages, and replace them with the new ones for 'completeness'?
I have the new scenarios generated and can provide you the link. @anthonyfok

@wkhchow for sure! Sorry I missed your comment earlier, and failed to connect the dots when you first brought it up on Slack. Thank you for your reminder at Iteration Review last Thursday! The relevant GeoPackage files have been replaced in commit c35cf72. Cheers!

Copy link
Collaborator

@tieganh tieganh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All makes sense to me

There are now enough scenarios for it to be really helpful.
Thanks to Damon Ulmi (@DamonU2) for creating the map in October 2021!

(Also make minor tweaks to punctuations and French translations.)
@anthonyfok anthonyfok linked an issue Apr 18, 2023 that may be closed by this pull request
@anthonyfok anthonyfok merged commit ab09d26 into master Apr 18, 2023
@anthonyfok anthonyfok temporarily deployed to github-pages April 18, 2023 23:19 — with GitHub Pages Inactive
@anthonyfok anthonyfok deleted the rename-and-organize branch April 19, 2023 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renaming scenarios in GitHub [Pages]
5 participants