Skip to content

Unit handling needs many more tests #18278

@QuLogic

Description

@QuLogic

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy