File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change 4
4
import six
5
5
from six .moves import xrange , zip , zip_longest
6
6
7
- from collections import Sized
8
7
import functools
9
8
import itertools
10
9
import math
@@ -3020,8 +3019,7 @@ def extract_err(err, data):
3020
3019
# special case for empty lists
3021
3020
if len (err ) > 1 :
3022
3021
fe = safe_first_element (err )
3023
- if (len (err ) != len (data )
3024
- or isinstance (fe , Sized ) and len (fe ) > 1 ):
3022
+ if (len (err ) != len (data ) or np .size (fe ) > 1 ):
3025
3023
raise ValueError ("err must be [ scalar | N, Nx1 "
3026
3024
"or 2xN array-like ]" )
3027
3025
# using list comps rather than arrays to preserve units
Original file line number Diff line number Diff line change @@ -2311,7 +2311,7 @@ def safe_first_element(obj):
2311
2311
pass
2312
2312
raise RuntimeError ("matplotlib does not support generators "
2313
2313
"as input" )
2314
- return next (filter ( lambda e : not np . ma . is_masked ( e ), iter (obj ) ))
2314
+ return next (iter (obj ))
2315
2315
2316
2316
2317
2317
def sanitize_sequence (data ):
You can’t perform that action at this time.
0 commit comments