Skip to content

Commit

Permalink
Merge PR #322 (Flag timers that differ by more than +/- 10%)
Browse files Browse the repository at this point in the history
This merge brings PR #332 (Now flag GEOS-Chem Classic/GCHP timers that
differ by more than 10% in the benchmark timing tables, by @yantosca)
into the GCPy development stream.

This PR does the following:
1. Changes % difference from scientific notation to floating-point notation
2. Adds a "*" character next to timers that differ by more than +/- 10%

Signed-off-by: Bob Yantosca <[email protected]>
  • Loading branch information
yantosca committed Aug 19, 2024
2 parents de83662 + b07327d commit f2fe1fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ All notable changes to GCPy will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - TBD
### Changed
- Changed format of `% diff` column from `12.3e` to `12.3f` in benchmark timing tables

### Fixed
- Fixed formatting error in `.github/workflows/stale.yml` that caused the Mark Stale Issues action not to run
- Added brackets around `exempt-issue-labels` list in `.github/workflows/stale.yml`
- Now flag differences greater than +/- 10% in benchmark timing table outputs

## [1.5.0] - 2024-05-29
### Added
Expand Down
4 changes: 3 additions & 1 deletion gcpy/benchmark/modules/benchmark_scrape_gcclassic_timers.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ def print_timer(key, ref, dev, ofile):
pctdiff = np.nan
if np.abs(ref[key] > 0.0):
pctdiff = ((dev[key] - ref[key]) / ref[key]) * 100.0
line = f"{key:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3e}"
line = f"{key:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3f}"
if np.abs(pctdiff) >= 10.0: # Flag diffs > +/- 10%
line += " *"
print(line, file=ofile)


Expand Down
4 changes: 3 additions & 1 deletion gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ def print_timer(key, ref, dev, ofile):
if np.abs(ref[key] > 0.0):
pctdiff = ((dev[key] - ref[key]) / ref[key]) * 100.0
line = \
f"{label:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3e}"
f"{label:<22} {ref[key]:>18.3f} {dev[key]:>18.3f} {pctdiff:>12.3f}"
if np.abs(pctdiff) >= 10.0: # Flag diffs > +/- 10%
line += " *"
print(line, file=ofile)


Expand Down

0 comments on commit f2fe1fe

Please sign in to comment.