-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
handling of color=None by eventplot(), fixes #3728 #3729
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
handling of color=None by eventplot(), fixes #3728 #3729
Conversation
Could you please add a test to make sure this gets called? Apparently the only tests we have now explicitly pass in the color kwarg. |
I've tried to add a simple test case, but having never written one for matplotlib before I'm having trouble getting nose to actually run the test. I added the following lines to @image_comparison(baseline_images=['test_eventplot_defaults'], remove_text=True)
def test_eventplot_defaults():
'''
test that eventplot produces the correct output given the default params
(see bug #3728)
'''
np.random.seed(0)
data1 = np.random.random([32, 20]).tolist()
data2 = np.random.random([6, 20]).tolist()
data = data1 + data2
fig = plt.figure()
axobj = fig.add_subplot(111)
colls = axobj.eventplot(data) When I try to call the test, using
I get the following error: E
======================================================================
ERROR: Failure: ValueError (No such test test_eventplot_defaults)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alistair/.venvs/matplotlib_dev/local/lib/python2.7/site-packages/nose-1.3.0-py2.7.egg/nose/failure.py", line 41, in runTest
raise self.exc_class(self.exc_val)
ValueError: No such test test_eventplot_defaults
----------------------------------------------------------------------
Ran 1 test in 0.002s
FAILED (errors=1) What am I missing here? |
I think that the tests runs on the installed version of the code so you should probably install it before the test is found. |
Thanks Jens, it turned out to be a |
@@ -2187,6 +2187,23 @@ def test_eventplot(): | |||
np.testing.assert_equal(num_collections, num_datasets) | |||
|
|||
|
|||
@image_comparison(baseline_images=['test_eventplot_defaults'], remove_text=True) |
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 probably only need the png test here. Can you add extensions=['png']
as a kwarg and then amend your last commit to drop the pdf/svg images.
af9c108
to
e754807
Compare
BUG : handling of color=None by eventplot(), fixes #3728
@alimuldal Thanks! |
BUG : handling of color=None by eventplot(), fixes #3728
cherry-picked to 1.4.x as d684890 |
No description provided.