| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
|
||
| @pytest.mark.style('default') | ||
| @check_figures_equal(extensions=["png"]) | ||
| def test_overliding_units(fig_test, fig_ref): |
There was a problem hiding this comment.
"overliding"?
Sorry, something went wrong.
There was a problem hiding this comment.
l and r are next to each other on my keyboard. I wish I could blame all of my miss-spellings on poor typing as easily as this one...
Sorry, something went wrong.
There was a problem hiding this comment.
ah, dvorak? :)
Sorry, something went wrong.
| from datetime import datetime | ||
|
|
||
| t0 = datetime(2018, 3, 1) | ||
| t1 = datetime(2018, 3, 2) | ||
| t2 = datetime(2018, 3, 3) | ||
| t3 = datetime(2018, 3, 4) | ||
|
|
There was a problem hiding this comment.
what's the point of adding in the datetime here if that's not what's being tested?
Sorry, something went wrong.
There was a problem hiding this comment.
It is a converter class that does not care about the value of Axis.units, but I think it is worth putting units on both Axis.
Sorry, something went wrong.
There was a problem hiding this comment.
Would it be better to test using some data that does care about/use units? I'm wondering if datetime always has the units set to None all the time anyway.
Sorry, something went wrong.
There was a problem hiding this comment.
The string catarogicals do use Axis.units to store critical state (which is what broke in #11095).
Sorry, something went wrong.
There was a problem hiding this comment.
Oh woops, I missed that categoricals were being plotted too
Sorry, something went wrong.
There was a problem hiding this comment.
@tacaswell so that's what concerns me, that you're putting two potential points of failure in this test - when it fails will it be easy to see that it was the categoricals that broke this?
Sorry, something went wrong.
There was a problem hiding this comment.
All of our tests as pretty much closer to integration tests than unit tests. I am optimistic that if (when) this break who ever is debugging it will be able to sort out the root cause with out too much trouble.
Sorry, something went wrong.
| from datetime import datetime | ||
|
|
||
| t0 = datetime(2018, 3, 1) | ||
| t1 = datetime(2018, 3, 2) | ||
| t2 = datetime(2018, 3, 3) | ||
| t3 = datetime(2018, 3, 4) | ||
|
|
There was a problem hiding this comment.
Would it be better to test using some data that does care about/use units? I'm wondering if datetime always has the units set to None all the time anyway.
Sorry, something went wrong.
There was a problem hiding this comment.
Just typos; otherwise looks fine.
Sorry, something went wrong.
| .. warning :: | ||
|
|
||
| This method may mutate the dictionary passed in an kwargs and | ||
| the Axes instances attached to this Axes. |
There was a problem hiding this comment.
"passed in an kwargs" -> "passed in as kwargs"
"the Axes instances" -> "the Axis instances"
Sorry, something went wrong.
If the user passes None, treat as if they had passed nothing and do not try to change the units on the respective axis. closes matplotlib#11095 Co-authored-by: David Stansby <dstansby@gmail.com>
| Back | FazBrowse Home | New Git URL |
PR Summary
If the user passes None, treat as if they had passed nothing and do
not try to change the units on the respective axis.
closes #11095
I still need to write an API changes note (even though this is fixing a regression, it is a very old regression).
I don't think this conflicts with #17824 as the improved error message is a good idea independent of if this goes in.
PR Checklist