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

[ENH]: UnitizedNorm #27706

Open
Open
@story645

Description

@story645

NOTE: This is very much in the discussion nobody should actually attempt it phase. Especially since#27721 is a probably better solution to the same meta problem.

Problem

Lots of requests for colormapping unitized data, such as#7383,#25062,#23991,#19476,#17447

Proposed solution

Since the number -> number that can be colormapped conversion is done in the norm, proposing that we make an explicit Norm for handling units:

UnitizedNorm:

Create a new norm objectUnitizedNorm:

  • maps data to numbers using{Convertor}.convert
  • labels colorbar using the formatters from{Convertor}.axisinfo

The hard work here is integrating this into the existing color-mapping pipeline, particularly the interpolation pipeline. One approach may be to add a flag indicating whether the unit can participate in existing schemes or whether it provides its own interpolation methods. If this works, then.UnitizedNorm can be shimmed in to act as an analogue toNoNorm

UnitizedNorm(Normalize)

I don't know if this is actually possible, or remotely worth the effort given@ksunden's work, but a follow on proposal is thatUnitizedNorm acts as a wrapper aroundNormalize objects so that the norms can take in unitized inputs, whereUnitizedNorm(NoNorm) == UnitizedNorm() is the default described above. The objective would be to allow support for things like
`UnitizedNorm(BoundaryNorm(['2011-01-01', '2011-02-01', '2011-03-01']))' or "UnitizedNorm(Normalize(vmin=Pint(10))"

Pretty sure that if this is possible, it ends up being some sorta dynamic monkeypatching of the existing class. But also if possible then it can be written as a decorator and that would be nice to have for custom Norms.

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