Skip to content

Literal[...] type annotations for named colormaps #105

@clbarnes

Description

@clbarnes

It would be helpful if named colormaps could be more discoverable/ autocompleted by using ColormapName = Literal["viridis", "viridis_r", ...].
The ColormapLike type union would then include this in the instead of a raw str.
The ColormapName annotation could be generated by a script from the data files to make sure they're in sync. This also be run on CI to reject builds where it's out of sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions