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

Appearance settings

Unit handling needs many more tests #18278

Copy link
Copy link
Open
@QuLogic

Description

@QuLogic
Issue body actions

Problem

I've gone down a bit of a rabbit hole with #17930, and I've noticed that our testing for units is rather sparse. lib/matplotlib/tests/test_units.py only really checks plot, scatter, axhline, axvline, and bar, but we have many more artists that are peppered with unit conversion handling.

Proposed Solution

We need to expand test_units.py to cover almost all artist-creating functions that need to handle units. Now we have check_figures_equal, so we can do something about it that doesn't explore the number of test images, with a plot reference figure with non-unit functions, and a plot test figure with unitized functions.

I don't really understand what the expected unit conversion interface is, so I don't know how exactly to write the tests. I tried to do one for errorbar using Quantity, but it didn't work and I don't know if that's because Quantity does not implement enough for the unit registry, or whether errorbar doesn't correctly handle units.

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.