Skip to content

Increase coverage to 85% with targeted tests#636

Merged
cvanelteren merged 3 commits intomainfrom
chore/increase-coverage-85
Mar 19, 2026
Merged

Increase coverage to 85% with targeted tests#636
cvanelteren merged 3 commits intomainfrom
chore/increase-coverage-85

Conversation

@cvanelteren
Copy link
Collaborator

@cvanelteren cvanelteren commented Mar 19, 2026

The last couple of months was slowly chipping away at this. This PR increases the coverage to something that we can proud of sure of when moving forward.

It also fixes some minor bugs that were missed due to lack of coverage -- these are mainly API changes outside ours or small regressions that were missed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR focuses on raising overall test coverage (targeting ~85%) by adding targeted unit tests for previously under-covered helper utilities, while also including a few small correctness/robustness fixes in core modules.

Changes:

  • Added focused tests for text helpers, scales/transforms, rcsetup validators, projections, plotting input helpers, and several “extra” test modules to improve branch coverage.
  • Fixed Mercator inverse latitude transform to match the documented inverse formula.
  • Fixed CutoffTransform distance initialization for zero-scale segments and hardened colormap translation / rcsetup iterable checks.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ultraplot/tests/test_text_helpers.py Adds coverage for CurvedText validation, curve setters/getters, ellipsis/upright logic, and draw/update edge cases.
ultraplot/tests/test_scale_helpers.py Adds tests for scale parsing, transform roundtrips, range limiting, and scale factory behaviors.
ultraplot/tests/test_rcsetup_helpers.py Covers rcsetup validators/helpers including YAML/RST helpers and rcparams rename/remove logic.
ultraplot/tests/test_proj_helpers.py Adds tests for custom Cartopy projections’ defaults, warnings, and parameter wiring.
ultraplot/tests/test_inputs_helpers.py Adds coverage for internal input conversion, masking, distribution helpers, and geographic helpers.
ultraplot/tests/test_constructor_helpers_extra.py Adds branch coverage for constructors (Colormap/Cycle/Norm/Locator/Formatter/Scale/Proj).
ultraplot/tests/test_config_helpers_extra.py Adds branch coverage for configuration helpers including style parsing, context modes, and config IO.
ultraplot/tests/test_colors_helpers.py Adds tests for color/clipping helpers, lookup tables, norms, translation, and cache behavior.
ultraplot/tests/test_colormap_helpers_extra.py Adds branch coverage for colormap save/load, conversion methods, and registry/database helpers.
ultraplot/tests/test_colorbar_helpers_extra.py Adds branch coverage for inset colorbar layout, measurement, locator resolution, and reflow behavior.
ultraplot/tests/test_axes_base_colorbar_helpers.py Mirrors inset colorbar helper coverage for axes.base implementation.
ultraplot/scale.py Corrects Mercator inverse transform and fixes zero-scale distance indexing in CutoffTransform.
ultraplot/proj.py Adjusts proj4 parameter initialization format for warped projections.
ultraplot/internals/rcsetup.py Switches iterable detection to np.iterable and avoids errors when YAML table data is empty.
ultraplot/colors.py Hardens _translate_cmap by safely handling missing .name and validating type earlier.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 99.69419% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ultraplot/tests/test_scale_helpers.py 98.01% 3 Missing ⚠️
ultraplot/internals/rcsetup.py 80.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@cvanelteren cvanelteren enabled auto-merge (squash) March 19, 2026 19:39
@cvanelteren cvanelteren merged commit 7c012de into main Mar 19, 2026
16 of 19 checks passed
@cvanelteren cvanelteren deleted the chore/increase-coverage-85 branch March 19, 2026 20:17
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.

2 participants