Skip to content

Commit

Permalink
Hotfix v0.9.1: matplotlib 3 support (#724)
Browse files Browse the repository at this point in the history
This hotfix adds matplotlib3 support by requiring any version
of mpl except for 3.0.0 which had a backend bug that affected
Yellowbrick. Note that this hotfix includes changes to tests
that will need to be resolved when merging from develop.
  • Loading branch information
bbengfort committed Feb 6, 2019
1 parent ce77386 commit d9f4bed
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Library Dependencies
matplotlib>=1.5.1,<3.0
matplotlib>=1.5.1,!=3.0.0
scipy>=0.19
scikit-learn>=0.19
numpy>=1.13.0
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Dependencies
matplotlib>=1.5.1,<3.0
matplotlib>=1.5.1,!=3.0.0
scipy>=1.0.0
scikit-learn>=0.20
numpy>=1.13.0
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
## Test Constants
##########################################################################

EXPECTED_VERSION = "0.9"
EXPECTED_VERSION = "0.9.1"


##########################################################################
Expand Down
4 changes: 2 additions & 2 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Library Dependencies
matplotlib>=1.5.1,<3.0
matplotlib>=1.5.1,!=3.0.0
scipy>=0.19
scikit-learn>=0.19
numpy>=1.13.0
cycler>=0.10.0

# Testing Requirements
pytest>=3.4.1
pytest>=3.4.1,<4.2.0
pytest-cov>=2.5.1
pytest-flakes>=2.0.0
pytest-spec>=1.1.0
Expand Down
3 changes: 3 additions & 0 deletions tests/test_classifier/test_confusion_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@ def test_isclassifier(self):
with pytest.raises(yb.exceptions.YellowbrickError, match=message):
ConfusionMatrix(model)

@pytest.mark.xfail(
sys.platform == 'win32', reason="Changing the dtype to a subarray type is only supported if the total itemsize is unchanged"
)
def test_score_returns_score(self):
"""
Test that ConfusionMatrix score() returns a score between 0 and 1
Expand Down
2 changes: 1 addition & 1 deletion tests/test_classifier/test_threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def test_splitter_random_state(self):
assert viz._check_cv(splits, random_state=23).random_state == 23

splits = StratifiedShuffleSplit(n_splits=1, random_state=181)
assert viz._check_cv(splits, random_state=None).random_state is 181
assert viz._check_cv(splits, random_state=None).random_state == 181
assert viz._check_cv(splits, random_state=72).random_state == 72

def test_bad_exclude(self):
Expand Down
11 changes: 10 additions & 1 deletion tests/test_contrib/test_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# Imports
##########################################################################

import sys
import pytest
import numpy as np
import matplotlib as mptl
Expand Down Expand Up @@ -137,6 +138,9 @@ def test_scatter_requires_two_features_in_numpy_matrix(self):
self.assertTrue(
'only accepts two features' in str(context.exception))

@pytest.mark.xfail(
sys.platform == 'win32', reason="Changing the dtype to a subarray type is only supported if the total itemsize is unchanged"
)
def test_integrated_scatter(self):
"""
Test scatter on the real, occupancy data set
Expand Down Expand Up @@ -174,7 +178,9 @@ def test_alpha_param(self):
assert "alpha" in scatter_kwargs
assert scatter_kwargs["alpha"] == 0.7


@pytest.mark.xfail(
sys.platform == 'win32', reason="Changing the dtype to a subarray type is only supported if the total itemsize is unchanged"
)
def test_scatter_quick_method(self):
"""
Test scatter quick method on the real, occupancy data set
Expand Down Expand Up @@ -217,6 +223,9 @@ def test_integrated_scatter_with_pandas(self):
visualizer = ScatterViz(features=features)
visualizer.fit_transform_poof(X, y)

@pytest.mark.xfail(
sys.platform == 'win32', reason="Changing the dtype to a subarray type is only supported if the total itemsize is unchanged"
)
def test_integrated_scatter_numpy_named_arrays(self):
"""
Test scatterviz on numpy named arrays
Expand Down
2 changes: 1 addition & 1 deletion yellowbrick/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
__version_info__ = {
'major': 0,
'minor': 9,
'micro': 0,
'micro': 1,
'releaselevel': 'final',
'serial': 13,
}
Expand Down

0 comments on commit d9f4bed

Please sign in to comment.