Skip to content

Fix _parse_level_norm docstring to reflect conditional return type#600

Merged
cvanelteren merged 4 commits intofix/issue-329-contour-color-mappingfrom
copilot/sub-pr-599
Feb 26, 2026
Merged

Fix _parse_level_norm docstring to reflect conditional return type#600
cvanelteren merged 4 commits intofix/issue-329-contour-color-mappingfrom
copilot/sub-pr-599

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

The Returns section of _parse_level_norm incorrectly declared norm as always returning a DiscreteNorm, but the function conditionally returns the original continuous Normalize when min_levels=1 (line contours) and the input norm is not a BoundaryNorm.

Changes

  • ultraplot/axes/plot.py: Updated _parse_level_norm docstring Returns section to document both possible return types:
    • ~ultraplot.colors.DiscreteNorm — standard case for filled contours
    • ~matplotlib.colors.Normalize — passthrough for line contours (min_levels=1) when input is not a BoundaryNorm

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

cvanelteren and others added 2 commits February 26, 2026 14:31
…e return types

Co-authored-by: cvanelteren <19485143+cvanelteren@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on contour level color mapping fix Fix _parse_level_norm docstring to reflect conditional return type Feb 26, 2026
@cvanelteren cvanelteren marked this pull request as ready for review February 26, 2026 04:40
@cvanelteren cvanelteren merged commit bf1dd57 into fix/issue-329-contour-color-mapping Feb 26, 2026
1 of 2 checks passed
@cvanelteren cvanelteren deleted the copilot/sub-pr-599 branch February 26, 2026 04:40
cvanelteren added a commit that referenced this pull request Feb 26, 2026
* Fix contour level color mapping with explicit limits

* Update ultraplot/axes/plot.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix `_parse_level_norm` docstring to reflect conditional return type (#600)

* Initial plan

* Update _parse_level_norm docstring Returns section to reflect possible return types

Co-authored-by: cvanelteren <19485143+cvanelteren@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Casper van Elteren <caspervanelteren@gmail.com>
Co-authored-by: cvanelteren <19485143+cvanelteren@users.noreply.github.com>

* Scope explicit contour limits to line contours

* Pass vmin/vmax through automatic level generation

* Restore default tricontour discrete mapping

* Format contour norm routing changes

* Clarify contour norm routing docs

* Refactor contour norm routing flow

* Refactor contour norm routing flags

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: cvanelteren <19485143+cvanelteren@users.noreply.github.com>
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