-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Parameterize test_fill_between and test_fill_betweenx #8729
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -847,40 +847,32 @@ def test_polycollection_joinstyle(): | |
ax.set_ybound(0, 3) | ||
|
||
|
||
def test_fill_between_2d_x_input(): | ||
x = np.zeros((2, 2)) | ||
y1 = 3 | ||
y2 = 3 | ||
|
||
fig = plt.figure() | ||
ax = fig.add_subplot(211) | ||
with pytest.raises(ValueError): | ||
ax.plot(x, y1, x, y2, color='black') | ||
ax.fill_between(x, y1, y2) | ||
|
||
|
||
def test_fill_between_2d_y1_input(): | ||
x = np.arange(0.0, 2, 0.02) | ||
y1 = np.zeros((2, 2)) | ||
y2 = 3 | ||
|
||
@pytest.mark.parametrize( | ||
'x, y1, y2', [ | ||
(np.zeros((2, 2)), 3, 3), | ||
(np.arange(0.0, 2, 0.02), np.zeros((2, 2)), 3), | ||
(np.arange(0.0, 2, 0.02), 3, np.zeros((2, 2))) | ||
] | ||
) | ||
def test_fill_between_input(x, y1, y2): | ||
fig = plt.figure() | ||
ax = fig.add_subplot(211) | ||
with pytest.raises(ValueError): | ||
ax.plot(x, y1, x, y2, color='black') | ||
ax.fill_between(x, y1, y2) | ||
|
||
|
||
def test_fill_between_2d_y2_input(): | ||
x = np.arange(0.0, 2, 0.02) | ||
y1 = 3 | ||
y2 = np.zeros((2, 2)) | ||
|
||
@pytest.mark.parametrize( | ||
'y, x1, x2', [ | ||
(np.zeros((2, 2)), 3, 3), | ||
(np.arange(0.0, 2, 0.02), np.zeros((2, 2)), 3), | ||
(np.arange(0.0, 2, 0.02), 3, np.zeros((2, 2))) | ||
] | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And some There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
def test_fill_betweenx_input(y, x1, x2): | ||
fig = plt.figure() | ||
ax = fig.add_subplot(211) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Anyone got any idea why this line is here? Looks pointless to me... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure this is the line you meant to comment on? How else would you plot without an Axes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤦♂️ I thought the previous line was |
||
with pytest.raises(ValueError): | ||
ax.plot(x, y1, x, y2, color='black') | ||
ax.fill_between(x, y1, y2) | ||
ax.fill_betweenx(y, x1, x2) | ||
|
||
|
||
@image_comparison(baseline_images=['fill_between_interpolate'], | ||
|
@@ -4995,42 +4987,6 @@ def test_tick_param_label_rotation(): | |
assert text.get_rotation() == 90 | ||
|
||
|
||
def test_fill_betweenx_2d_y_input(): | ||
y = np.zeros((2, 2)) | ||
x1 = 3 | ||
x2 = 3 | ||
|
||
fig = plt.figure() | ||
ax = fig.add_subplot(211) | ||
with pytest.raises(ValueError): | ||
ax.plot(y, x1, y, x2, color='black') | ||
ax.fill_betweenx(y, x1, x2) | ||
|
||
|
||
def test_fill_betweenx_2d_x1_input(): | ||
y = np.arange(0.0, 2, 0.02) | ||
x1 = np.zeros((2, 2)) | ||
x2 = 3 | ||
|
||
fig = plt.figure() | ||
ax = fig.add_subplot(211) | ||
with pytest.raises(ValueError): | ||
ax.plot(y, x1, y, x2, color='black') | ||
ax.fill_betweenx(y, x1, x2) | ||
|
||
|
||
def test_fill_betweenx_2d_x2_input(): | ||
y = np.arange(0.0, 2, 0.02) | ||
x1 = 3 | ||
x2 = np.zeros((2, 2)) | ||
|
||
fig = plt.figure() | ||
ax = fig.add_subplot(211) | ||
with pytest.raises(ValueError): | ||
ax.plot(y, x1, y, x2, color='black') | ||
ax.fill_betweenx(y, x1, x2) | ||
|
||
|
||
@pytest.mark.style('default') | ||
def test_fillbetween_cycle(): | ||
fig, ax = plt.subplots() | ||
|
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.
Please add some
ids
to this call; you can use the unique parts of the original functions names, probably.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.
Thanks for pointing that out. Added.