Skip to content

Fix output plot unit labels#1139

Open
GHX5T-SOL wants to merge 1 commit into
PSLmodels:masterfrom
GHX5T-SOL:fix-plot-label-units
Open

Fix output plot unit labels#1139
GHX5T-SOL wants to merge 1 commit into
PSLmodels:masterfrom
GHX5T-SOL:fix-plot-label-units

Conversation

@GHX5T-SOL
Copy link
Copy Markdown

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.

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

1 participant