8000 Update test_cbook.py · high-in-entropy/matplotlib@9129737 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9129737

Browse files
Update test_cbook.py
1 parent a305c53 commit 9129737

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

lib/matplotlib/tests/test_cbook.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -484,50 +484,6 @@ def test_flatiter():
484484
assert 1 == next(it)
485485

486486

487-
def test_reshape2d():
488-
class dummy():
489-
pass
490-
x = [dummy() for j in range(5)]
491-
xnew = cbook._reshape_2D(x, 'x')
492-
assert np.shape(xnew) == (1, 5)
493-
494-
x = np.arange(5)
495-
xnew = cbook._reshape_2D(x, 'x')
496-
assert np.shape(xnew) == (1, 5)
497-
498-
x = [[dummy() for j in range(5)] for i in range(3)]
499-
xnew = cbook._reshape_2D(x, 'x')
500-
assert np.shape(xnew) == (3, 5)
501-
502-
# this is strange behaviour, but...
503-
x = np.random.rand(3, 5)
504-
xnew = cbook._reshape_2D(x, 'x')
505-
assert np.shape(xnew) == (5, 3)
506-
507-
508-
def test_contiguous_regions():
509-
a, b, c = 3, 4, 5
510-
# Starts and ends with True
511-
mask = [True]*a + [False]*b + [True]*c
512-
expected = [(0, a), (a+b, a+b+c)]
513-
assert cbook.contiguous_regions(mask) == expected
514-
d, e = 6, 7
515-
# Starts with True ends with False
516-
mask = mask + [False]*e
517-
assert cbook.contiguous_regions(mask) == expected
518-
# Starts with False ends with True
519-
mask = [False]*d + mask[:-e]
520-
expected = [(d, d+a), (d+a+b, d+a+b+c)]
521-
assert cbook.contiguous_regions(mask) == expected
522-
# Starts and ends with False
523-
mask = mask + [False]*e
524-
assert cbook.contiguous_regions(mask) == expected
525-
# No True in mask
526-
assert cbook.contiguous_regions([False]*5) == []
527-
# Empty mask
528-
assert cbook.contiguous_regions([]) == []
529-
530-
531487
def test_safe_first_element_pandas_series(pd):
532488
# delibrately create a pandas series with index not starting from 0
533489
s = pd.Series(range(5), index=range(10, 15))

0 commit comments

Comments
 (0)
0