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

Add benchmark script to create species changes tables for GEOS-Chem wiki #337

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

yantosca
Copy link
Contributor

Name and Institution (Required)

Name: Bob Yantosca
Institution: Harvard + GCST

Describe the update

This PR adds a script to print tables (in MediaWiki format) of GEOS-Chem species that were added or removed between two GEOS-Chem benchmark versions. It is called with e.g.:

$ python -m gcpy.benchmark.modules.benchmark_species_changes \
   --ref-label "14.4.0"                                      \
   --ref-log   "gcc_14.4.0/14.4.0.log                        \
   --dev-label "14.5.0"                                      \
   --dev-log   "gcc_14.5.0/14.5.0.log"                       \
   --spcdb-dir "gcc_14.5.0/14.5.0.log"                       \
   --output-file "wiki_tables.txt"

We also have modified the "Added" entries in the CHANGELOG.md file so that they start with the verb "Added".

Expected changes

This PR is a zero-diff update w/r/t existing benchmark functionality. It adds a script that can be manually called to generate tables of species that have changed between benchmarks.

gcpy/benchmark/modules/benchmark_species_changes.py
- Added this script to compute a table of species that have changed
  between each version, along with corresponding metadata

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <[email protected]>
gcpy/benchmark/modules/benchmark_species_changes.py
- Add Pydoc headers
- Add code to generate the wiki tables for "Species added"
  and "Species removed"
- Print out the list of species with changed attributes (you then
  can use this info to manually create the table)
- Now use argparse to handle input arguments

Signed-off-by: Bob Yantosca <[email protected]>
gcpy/benchmark/modules/benchmark_species_changes.py
- Renamed function "create_wiki_tables"
  to "make_benchmark_species_changes_wiki_tables"

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca yantosca added category: Feature Request New feature or request topic: Benchmark Plots and Tables Issues pertaining to generating plots/tables from benchmark output labels Sep 11, 2024
@yantosca yantosca self-assigned this Sep 11, 2024
Copy link
Contributor

@lizziel lizziel left a comment

Choose a reason for hiding this comment

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

Thanks for this update. Could you add a sample of what the output table looks like in the comments?

gcpy/benchmark/modules/benchmark_species.py
- Added a new line (\n) after the line with bgcolor, in order to
  have the table render properly.

Signed-off-by: Bob Yantosca <[email protected]>
gcpy/benchmark/modules/benchmark_species_changes.py
- Add "\n" after cellpadding in the first table header line
- Add bgcolor tag for each header column
- Now use proper Heading 3 tag ("=== ===")

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca
Copy link
Contributor Author

yantosca commented Oct 3, 2024

Thanks @lizziel. Running this command:

python -m gcpy.benchmark.modules.benchmark_species_changes \
 --ref-label "14.5.0-alpha.5"                              \
 --ref-log   "14.5.0-alpha.5/runlog.txt"                   \
 --dev-label "14.5.0-alpha.9"                              \
 --dev-log   "14.5.0-alpha.9/runlog.txt"                   \
 --spcdb-dir "14.5.0-alpha.9"                              \
 --output-file "wiki_tables.txt"

gives this output

Species with changes (also check advected species)

ALK4N2 {'DryDepId': {'Ref': False, 'Dev': True}}
ALK4P {'DryDepId': {'Ref': False, 'Dev': True}}
PPN {'PhotolId': {'Ref': False, 'Dev': True}}
RCOOH {'DryDepId': {'Ref': False, 'Dev': True}, 'WetDepId': {'Ref': False, 'Dev': True}}

and also writes these tables
wiki_tables.txt

Which looks like this:
wiki1

and this
wiki2

We can skip posting a table to the wiki if it has no species added/removed.

@yantosca yantosca requested a review from lizziel October 3, 2024 19:18
@yantosca yantosca added this to the 1.6.0 milestone Oct 3, 2024
Copy link
Contributor

@lizziel lizziel left a comment

Choose a reason for hiding this comment

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

This looks good to merge. We will still need to do a manual comparison of the files to flag species that changed and then document those by hand, but that's okay. Maybe future work could be to check on species that changed and how.

@yantosca yantosca merged commit 2bb5adc into dev Oct 4, 2024
14 checks passed
@yantosca yantosca deleted the feature/benchmark-species-changes branch October 4, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Feature Request New feature or request topic: Benchmark Plots and Tables Issues pertaining to generating plots/tables from benchmark output
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants