New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removal of matplotlib<3 compatibility checks #2665
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good for me
those MATPLOTLIB_VERSION == [3, 0, 1]
are all related to basemap issues which needs to be fixed later anyway
Yeah, I think the plan is to drop the basemap completely but for now I just figured out to keep it. |
O, I caused few new errors on Flake8, I will fix them in a minute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. We might need some reltol
tweaks again later maybe.. but I guess we can readd it when/if needed. 👍
Okay, flake8 fixed almost completely. However, there are two errors that pop out:
Well the errors are there, however, last time it was touched was in 2016 by @krischer. |
Oooookay. Dragons live there in that code. Basically, there are only few blockette objects that are tested. Blockette010, Blockette051, Blockette053, Blockette054 So those ones are not tested at all it seems. |
And the error came from Flake8 including support to pyflakes 2.2.x. PyCQA/flake8@76eecca |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default reltol
is 1, so you should just remove any explicit usage of it when it's also 1.
obspy/core/util/testing.py
Outdated
@@ -337,30 +332,7 @@ def __init__(self, image_path, image_name, reltol=1, | |||
# has been fixed. | |||
# | |||
# Thus test images should accurate for matplotlib >= 2.0.1 anf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Thus test images should accurate for matplotlib >= 2.0.1 anf | |
# Thus test images should accurate for matplotlib >= 2.0.1. |
@@ -43,11 +43,7 @@ def test_ppsd_plot_frequency(self): | |||
""" | |||
Test plot of ppsd example data, normal (non-cumulative) style. | |||
""" | |||
# mpl < 2.2 has slightly offset ticks/ticklabels, so needs a higher | |||
# tolerance (see e.g. http://tests.obspy.org/102260) | |||
reltol = 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline this in the ImageComparison
call.
I've mentioned those before in #2631, they are unrelated but should get fixed. I was hoping somebody that actually worked on the blockette stuff more could have a look, because I would have to look up details for these blockettes first and would probably just go by some examples I find. |
I'll take a look |
@QuLogic done, take a look please. |
Don't forget this part. |
Fixed. @QuLogic |
Signed-off-by: Damian Kula <dkula@unistra.fr>
Signed-off-by: Damian Kula <dkula@unistra.fr>
Signed-off-by: Damian Kula <dkula@unistra.fr>
Signed-off-by: Damian Kula <dkula@unistra.fr>
Signed-off-by: Damian Kula <dkula@unistra.fr>
… default Signed-off-by: Damian Kula <dkula@unistra.fr>
575f00c
to
62dc623
Compare
Rebased on current master and force pushed. |
Hmm.. I guess we might want to consider updating all test baseline images on master too? Since we bumped matplotlib massively and I think many of those were done on older matplotlib versions.. I guess we want to use matplotlib 3.2.0 as our new min dependency version for all baseline images from now on? We can also do this in another PR, though. Otherwise this looks ready to go. |
Well, you are right about that. Since now we don't have that much of a wiggle with versions, we could just update everything. Also, I think the basemap is not compatible with matplotlib 3 so we should also do that long overdue migration to cartopy. But I think it should belong to a different PR. |
Sounds good, lets merge this first of all then. |
I noticed a few TODOs to remove some compatibility checks when minimum matplotlib version will be higher than 2.0. Since we have minimum of 3.2 now, I went ahead and removed them. I also searched the codebase for all checks agains
MATPLOTLIB_VERSION
and I removed all that were checking for versions <3.0. There are left a few of them that are checking forMATPLOTLIB_VERSION == [3, 0, 1]
but since we still support 3 as a major version, I didn't touch them.