-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
COMPAT: Matplotlib 2.2 compatability #20079
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
01864d0
REF: cleanup mpl version cehcking
TomAugspurger f028546
COMPAT: update timedelta handling for mpl 2.2.0
TomAugspurger 5380375
Linting
TomAugspurger 456f7f5
Linting
TomAugspurger f284ffe
Merge remote-tracking branch 'upstream/master' into mpl-2.2
TomAugspurger ef0d6ad
Merge remote-tracking branch 'upstream/master' into mpl-2.2
TomAugspurger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,31 @@ | ||
# being a bit too dynamic | ||
# pylint: disable=E1101 | ||
from __future__ import division | ||
import operator | ||
|
||
from distutils.version import LooseVersion | ||
|
||
|
||
def _mpl_le_1_2_1(): | ||
try: | ||
import matplotlib as mpl | ||
return (LooseVersion(mpl.__version__) <= LooseVersion('1.2.1') and | ||
def _mpl_version(version, op): | ||
def inner(): | ||
try: | ||
import matplotlib as mpl | ||
except ImportError: | ||
return False | ||
return (op(LooseVersion(mpl.__version__), LooseVersion(version)) and | ||
str(mpl.__version__)[0] != '0') | ||
except ImportError: | ||
return False | ||
|
||
return inner | ||
|
||
def _mpl_ge_1_3_1(): | ||
try: | ||
import matplotlib | ||
# The or v[0] == '0' is because their versioneer is | ||
# messed up on dev | ||
return (LooseVersion(matplotlib.__version__) >= | ||
LooseVersion('1.3.1') or | ||
str(matplotlib.__version__)[0] == '0') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_1_4_0(): | ||
try: | ||
import matplotlib | ||
return (LooseVersion(matplotlib.__version__) >= LooseVersion('1.4') or | ||
str(matplotlib.__version__)[0] == '0') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_1_5_0(): | ||
try: | ||
import matplotlib | ||
return (LooseVersion(matplotlib.__version__) >= LooseVersion('1.5') or | ||
str(matplotlib.__version__)[0] == '0') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_2_0_0(): | ||
try: | ||
import matplotlib | ||
return LooseVersion(matplotlib.__version__) >= LooseVersion('2.0') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_le_2_0_0(): | ||
try: | ||
import matplotlib | ||
return matplotlib.compare_versions('2.0.0', matplotlib.__version__) | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_2_0_1(): | ||
try: | ||
import matplotlib | ||
return LooseVersion(matplotlib.__version__) >= LooseVersion('2.0.1') | ||
except ImportError: | ||
return False | ||
|
||
|
||
def _mpl_ge_2_1_0(): | ||
try: | ||
import matplotlib | ||
return LooseVersion(matplotlib.__version__) >= LooseVersion('2.1') | ||
except ImportError: | ||
return False | ||
_mpl_ge_1_2_1 = _mpl_version('1.2.1', operator.ge) | ||
_mpl_le_1_2_1 = _mpl_version('1.2.1', operator.le) | ||
_mpl_ge_1_3_1 = _mpl_version('1.3.1', operator.ge) | ||
_mpl_ge_1_4_0 = _mpl_version('1.4.0', operator.ge) | ||
_mpl_ge_1_4_1 = _mpl_version('1.4.1', operator.ge) | ||
_mpl_ge_1_5_0 = _mpl_version('1.5.0', operator.ge) | ||
_mpl_ge_2_0_0 = _mpl_version('2.0.0', operator.ge) | ||
_mpl_le_2_0_0 = _mpl_version('2.0.0', operator.le) | ||
_mpl_ge_2_0_1 = _mpl_version('2.0.1', operator.ge) | ||
_mpl_ge_2_1_0 = _mpl_version('2.1.0', operator.ge) | ||
_mpl_ge_2_2_0 = _mpl_version('2.2.0', operator.ge) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
we originally had the mac skips on here (e.g. before 2.2). not really sure if they are still relevant though.
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.
I'm testing on a mac, so hopefully we're OK.