Allow iterables instead of only numpy arrays.
@@ -95,14 +95,14 @@ class Tracer(object):
# moment. The following checks try to guard against these instances
# but this should probably be checked for at the C level.
if tracer_type in [const.CL_TRACER_WL, const.CL_TRACER_NC, const.CL_TRACER_CL]:
- if not isinstance(dndz, collections.Iterable) or \
- len(dndz) != 2 or \
- not (isinstance(dndz[0], np.ndarray) and isinstance(dndz[1], np.ndarray)):
+ if not isinstance(dndz, collections.Iterable) \
+ or len(dndz) != 2 \
+ or not (isinstance(dndz[0], collections.Iterable) and isinstance(dndz[1], collections.Iterable)):
raise ValueError("dndz needs to be a tuple of two arrays.")
if tracer_type in [const.CL_TRACER_NC]:
- if not isinstance(bias, collections.Iterable) or \
- len(bias) != 2 or \
- not (isinstance(bias[0], np.ndarray) and isinstance(bias[1], np.ndarray)):
+ if not isinstance(bias, collections.Iterable) \
+ or len(bias) != 2 \
+ or not (isinstance(bias[0], collections.Iterable) and isinstance(bias[1], collections.Iterable)):
raise ValueError("bias needs to be a tuple of two arrays.")
# Convert array arguments that are 'None' into 'NoneArr' type and
