-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Unit handling needs many more tests #18278
Description
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.