[scitools] push by johannes...@gmail.com - Fix issue #35. on 2015-02-24 08:02 GMT

1 view
Skip to first unread message

scit...@googlecode.com

unread,
Feb 24, 2015, 3:02:42 AM2/24/15
to scitoo...@googlegroups.com
Revision: a2f023432a2c
Branch: default
Author: Johannes Ring <joh...@simula.no>
Date: Tue Feb 24 08:02:27 2015 UTC
Log: Fix issue #35.
https://code.google.com/p/scitools/source/detail?r=a2f023432a2c

Modified:
/lib/scitools/easyviz/common.py

=======================================
--- /lib/scitools/easyviz/common.py Sun Nov 3 08:28:57 2013 UTC
+++ /lib/scitools/easyviz/common.py Tue Feb 24 08:02:27 2015 UTC
@@ -8,7 +8,6 @@
_check_size, _check_type, _toggle_state, _update_from_config_file

from warnings import warn
-import collections


def docadd(comment, *lists, **kwargs):
@@ -392,7 +391,7 @@
# The proper casting should be in the backends plotroutine

if 'z' in kwargs:
- if not not isinstance(kwargs['z'], collections.Sequence):
+ if not operator.isSequenceType(kwargs['z']):
raise TypeError("Can only plot sequence types, "\
"z is %s" % type(kwargs['z']))
z = kwargs['z']
@@ -404,7 +403,7 @@
# now y is the indicies of z
y = list(range(len(z)))
else:
- if not isinstance(kwargs['y'], collections.Sequence):
+ if not operator.isSequenceType(kwargs['y']):
raise TypeError("Can only plot sequence types, "\
"y is %s" % type(kwargs['y']))
y = kwargs['y']
@@ -414,7 +413,7 @@
# now x is the indicies of y
x = list(range(len(y)))
else:
- if not isinstance(kwargs['x'], collections.Sequence):
+ if not operator.isSequenceType(kwargs['x']):
raise TypeError("Can only plot sequence types, "\
"x is %s" % type(kwargs['x']))
x = kwargs['x']
Reply all
Reply to author
Forward
0 new messages