Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[MNT]: Move norms to from colors.py to separate file norms.py #28690

Open
@trygvrad

Description

@trygvrad

Summary

Currently the data→norm→color pipeline involves two files:

  1. colors.py:
    1. Utility functions for working with colors
    2. Colormap and subclasses ofColormap
    3. Normalize and subclasses ofNormalize
  2. cm.py:
    1. The colormap registry
    2. ScalarMappable (holds data, norm and colormap)

In this structure, each file contains multiple parts of the pipeline, and it is not intuitive which part of the pipeline is located where.

With PR#28658 we are creatingcolorizer.py and the newColorizer object to improve the data→norm→color pipeline.
This has the added benefit that it greatly simplifiescm.py, which now only contains the colormap registry (and ScalarMappable for compatibility reasons).

Proposed fix

This issue suggests moving the norms to a separate file in order to clean upcolors.py. This, together with#28658 would lead to the following structure:

  1. colors.py:
    1. Utility functions for working with colors
    2. Colormap and subclasses ofColormap
  2. norms.py
    1. Normalize and subclasses ofNormalize
  3. cm.py:
    1. The colormap registry
  4. colorizer.py
    1. Colorizer (handles the data→norm→color pipeline)

With this structure, each file only contains a single part of the pipeline.

This issue came up because I was looking to implement multivariate color mapping (see issue#14168, and PRs#28454,#28658, [#28428]) , and for this we will need at least one more norm (i.e.MultiNorm).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp