Skip to content

Commit

Permalink
Now use floating-point for % diff in benchmark timing tables
Browse files Browse the repository at this point in the history
gcpy/benchmark/modules/benchmark_gcclassic_scrape_timers.py
gcpy/benchmark/modules/benchmark_gchp_scrape_timers.py
- Changed the "% diff" column from exponential format (12.3e) to
  floating-point format (12.3f) to make it easier to see large
  differences

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
  • Loading branch information
yantosca committed Aug 14, 2024
1 parent 4b2762b commit b07327d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ 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`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ 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
2 changes: 1 addition & 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,7 @@ 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 b07327d

Please sign in to comment.