[Matplotlib-devel] Units discussion...

David Stansby dstansby at gmail.com
Fri Feb 9 06:55:03 EST 2018


After having thought about this a bit more, apologies for jumping the gun.

I'm trying to learn more about how the units system works at the moment and
why it works that way. I'll probably try and improve the docs a bit as I go.

One question I have at the moment is why do some plotting methods pass
units through them quite a long way, instead of just doing the conversion
right at the beginning of the method? It seems like the obvious thing to do
to me is do the conversion immediately, but I'm sure there must be a good
reason to pass units through in some places.

David

On 9 February 2018 at 00:33, Jody Klymak <jklymak at uvic.ca> wrote:

>
>
> On 8 Feb 2018, at 15:18, Drain, Theodore R (392P) <
> theodore.r.drain at jpl.nasa.gov> wrote:
>
> On 8 February 2018 at 21:47, Drain, Theodore R (392P) <
> theodore.r.drain at jpl.nasa.gov<mailto:theodore.r.drain at jpl.nasa.gov
> <theodore.r.drain at jpl.nasa.gov>>> wrote:
> FYI for anyone interested - we already submitted (around the time of the
> first unit submit code in 2009) a mock of up our unit and time classes,
> with converters and tickers which is located in
> matplotlib/testing/jpl_units/.  It doesn't appear to be used in any tests
> anymore but it's there if anyone wants to look at it and was used in the
> original unit API testing.
>
>
>
> Aha! `jpl_units` *is* used for a few tests in `test_axes.py` and
> `test_dates.py`, and `test_patches.py`
>
> And those tests behave in what I’d say is a reasonable manner.  So maybe
> step 1 of coming up with a decent toy units system is accomplished.
>
> Steps 2 and 3 might be to add some more tests and some
> documentation/tutorial using the toy unit system.  I’m happy to give that a
> shot in the next few weeks.  Then we can move on to fixing the methods that
> don’t play well w/ units.
>
> Cheers,   Jody
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20180209/707e3bec/attachment.html>


More information about the Matplotlib-devel mailing list