Skip to content

Use namespaced "matplotlib:coolwarm" to silence cmap ambiguity warning - #1079

Merged
kushalkolar merged 1 commit into
fastplotlib:mainfrom
hmaarrfk:fix/coolwarm-cmap-namespace-warning
Sep 11, 2026
Merged

kushalkolar merged 1 commit into
fastplotlib:mainfrom
hmaarrfk:fix/coolwarm-cmap-namespace-warning

Conversation

@hmaarrfk

@hmaarrfk hmaarrfk commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Hey @kushalkolar hopefully this one liner is ok with you!

This avoids a warning like:

WARNING: The name 'coolwarm' is an alias for 'matplotlib:coolwarm', but is also available as: 'paraview:coolwarm'.
To silence this warning, use a fully namespaced name.

This PR was written by Mark's AI agent (Claude Code). Mark has not yet reviewed this PR.

Reviewed it now!

More stuff from claude

Summary

  • "coolwarm" is ambiguous in the cmap package's catalog (present in both the matplotlib and paraview namespaces), so cmap.Colormap("coolwarm") emits the ambiguity warning above.
  • Use the fully namespaced "matplotlib:coolwarm" in COLORMAPS, matching the pattern already used for other ambiguous names in that list (tol:, matlab:, vispy:, gnuplot:, yorick:).
  • This namespace syntax is supported by cmap>=0.1.3, which is already fastplotlib's declared minimum dependency, so no dependency bump is needed.

Test plan

  • Confirmed the warning no longer fires when importing fastplotlib.utils.functions after the change.
  • Confirmed "coolwarm" was not referenced as a literal string anywhere else in the codebase.

https://claude.ai/code/session_01XccZFAE1DAEaEx7LBhXE5W

<details><summary>Claude's draft</summary>

`cmap.Colormap("coolwarm")` is ambiguous because "coolwarm" exists in
both the matplotlib and paraview catalogs, so `cmap` emits:

    WARNING: The name 'coolwarm' is an alias for 'matplotlib:coolwarm',
    but is also available as: 'paraview:coolwarm'.
    To silence this warning, use a fully namespaced name.

Use the fully namespaced `"matplotlib:coolwarm"` in the `COLORMAPS`
list, matching the pattern already used for other ambiguous names in
this list (`tol:`, `matlab:`, `vispy:`, `gnuplot:`, `yorick:`). This is
supported by `cmap>=0.1.3`, which is already fastplotlib's declared
minimum, so no dependency bump is needed.

Resume this Claude session:
```
cd /Users/mark/git/pygfx/fastplotlib
claude --resume 4d91ae6a-7744-4d7e-90b3-d8c929fee89f
```
</details>

Claude-Session: https://claude.ai/code/session_01XccZFAE1DAEaEx7LBhXE5W
@hmaarrfk
hmaarrfk marked this pull request as ready for review September 10, 2026 16:34

@kushalkolar kushalkolar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@kushalkolar
kushalkolar merged commit 0117565 into fastplotlib:main Sep 11, 2026
25 of 41 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.

2 participants