Skip to content

Fix output plot unit labels#1139

Merged
jdebacker merged 1 commit into
PSLmodels:masterfrom
GHX5T-SOL:fix-plot-label-units
May 27, 2026
Merged

Fix output plot unit labels#1139
jdebacker merged 1 commit into
PSLmodels:masterfrom
GHX5T-SOL:fix-plot-label-units

Conversation

@GHX5T-SOL
Copy link
Copy Markdown
Contributor

Description

Fixes output plot y-axis labels for the unit cases in #1135.

Related Issues

Closes #1135

Type of Change

  • Feature (new functionality)
  • Change Request (modification of existing functionality)
  • Bug Fix
  • Refactoring (no behavior change)
  • Performance improvement
  • Documentation
  • CI / Build

Breaking Change?

  • Yes
  • No

If yes, describe the impact and migration path:

What was changed?

  • Label interest-rate plot_aggregates(..., plot_type="pct_diff") outputs as percentage point changes.
  • Label interest-rate plot_aggregates(..., plot_type="levels") outputs as rates instead of model units.
  • Label non-level plot_gdp_ratio outputs as percentage points of GDP.
  • Added regression assertions for the three label cases.

How was it tested?

Test-ID Status
T-001 .venv/bin/python -m pytest tests/test_output_plots.py -q passed, 50 tests
T-002 .venv/bin/ruff format --check ogcore/output_plots.py tests/test_output_plots.py passed
T-003 .venv/bin/ruff check ogcore/output_plots.py tests/test_output_plots.py passed
T-004 git diff --cached --check passed
T-005 `git diff --cached gitleaks stdin --no-banner --redact --timeout 30`

Local setup note: uv sync --extra dev could not complete on this macOS x86_64 machine because numba==0.65.1 tried to build llvmlite==0.47.0 without local LLVM development files. I ran the focused tests in a Python 3.11 editable environment using wheel-compatible numba==0.61.2; the changed code paths are limited to Matplotlib label selection and output plot tests.

Screenshots / Output (if applicable)

N/A

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review
  • I have added/updated tests (referencing issue Test-IDs)
  • All focused tests pass locally
  • I have updated the documentation
  • I have added a changelog entry
  • Breaking changes are documented with migration path

Reviewer Notes

The change is intentionally limited to axis labels and docs for existing plotted values; it does not alter plotted data.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.25%. Comparing base (1a3d8c9) to head (78aa743).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1139      +/-   ##
==========================================
+ Coverage   73.18%   73.25%   +0.06%     
==========================================
  Files          21       21              
  Lines        5233     5242       +9     
==========================================
+ Hits         3830     3840      +10     
+ Misses       1403     1402       -1     
Flag Coverage Δ
unittests 73.25% <100.00%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ogcore/output_plots.py 88.69% <100.00%> (+0.45%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jdebacker
Copy link
Copy Markdown
Member

@GHX5T-SOL Thanks for the PR. I confirmed updated labels when building plots. Merging.

@jdebacker jdebacker merged commit 4a8ef99 into PSLmodels:master May 27, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plot labels -- units

3 participants