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

Replace whitespace in Ref and Dev version labels in benchmarking code #340

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

yantosca
Copy link
Contributor

@yantosca yantosca commented Sep 12, 2024

Name and Institution (Required)

Name: Bob Yantosca
Institution: Harvard + GCST

Describe the update

This is the companion PR to #316. We have updated the benchmarking codes in gcpy/benchmark/modules/* (as described in commit cbee385) so that we now call the util.replace_whitespace function on the Ref and Dev version labels and in output file names.

We have also made minor changes (trimming whitespace, etc) suggested by Pylint.

Expected changes

If a user specifies e.g. version labels such as:

data:
  ref:
    gcc:
      version: gcc 14.2.0 rc 0
      ...
    gchp:
      version: gchp 14.2.0 rc 0
  ...
  dev:
    gcc:
      version: gcc 14.2.0 rc 2
      ...
    gchp:
      version: gchp 14.2.0 rc 2

then these will be printed out as

gcc_14.2.0_rc_0
gchp_14.2.0_rc_0
gcc_14.2.0_rc_2
gchp_14.2.0_rc.2

Related Github Issue

gcpy/benchmark/modules/benchmark_drydep.py
- Import "get_common_varnames" from benchmark_utils.py
  (suggested by Pylint)
- Call util.replace_whitespace on refstr and devstr

gcpy/benchmark/modules/benchmark_funcs.py
- Import replace_whitespace from gcpy.util module
- Call replace_whitespace on refstr and devstr in several routines
- Update comments

gcpy/benchmark/modules/benchmark_gcclassic_stats.py
gcpy/benchmark/modules/benchmark_mass_cons_table.py
gcpy/benchmark/modules/benchmark_models_vs_sondes.py
gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py
gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py
gcpy/benchmark/modules/oh_metrics.py
- Import replace_whitespace from gcpy.util module
- Call replace_whitespace on ref_label and dev_label

gcpy/benchmark/modules/benchmark_models_vs_obs.py
- Import replace_whitespace from gcpy.util module
- Call replace_whitespace on ref_label and dev_label
- Initialize lon, lat, alt to zero (suggested by Pylint)
- Align { } brackets

gcpy/benchmark/modules/budget_ox.py
- Move import gc higher in the list (suggested by Pylint)
- Now use "from gcpy import constants" (suggested by Pylint)
- Import replace_whitespace from gcpy.util module
- Call replace_whitespace on devstr
- Trim trailing whitespace (suggested by Pylint)

gcpy/benchmark/modules/budget_tt.py
- Move import gc higher in the list (suggested by Pylint)
- Now use "from gcpy import constants" (suggested by Pylint)
- Now use "from gcpy import util" (suggested by Pylint)
- Remove "from glob import glob" (suggested by Pylint)
- Call util.replace_whitespace on devstr
- Trim trailing whitespace (suggested by Pylint)

gcpy/benchmark/modules/budget_ox.py
- Move import gc higher in the list (suggested by Pylint)
- Now use "from gcpy import constants" (suggested by Pylint)
- Import replace_whitespace from gcpy.util module
- Call replace_whitespace on devstr
- Trim trailing whitespace (suggested by Pylint)

gcpy/benchmark/modules/ste_flux.py
- Call util.replace_whitespace on devstr

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca yantosca added topic: Benchmark Plots and Tables Issues pertaining to generating plots/tables from benchmark output category: Bug Fix Fixes a bug that was previously reported labels Sep 12, 2024
@yantosca yantosca added this to the 1.6.0 milestone Sep 12, 2024
@yantosca yantosca self-assigned this Sep 12, 2024
@yantosca yantosca marked this pull request as ready for review September 13, 2024 15:59
@yantosca yantosca merged commit 8771b50 into dev Sep 13, 2024
14 checks passed
@yantosca yantosca deleted the feature/replace-whitespace-in-labels branch September 13, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Fix Fixes a bug that was previously reported 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.

Replace whitespace with underscores in benchmark plot/table version labels and file names
2 participants