From 9d5c4adb6498a89c0952c813a55c2ce03238853c Mon Sep 17 00:00:00 2001 From: pbrod Date: Wed, 25 May 2016 22:43:48 +0200 Subject: [PATCH] Small fix --- wafo/misc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wafo/misc.py b/wafo/misc.py index c113601..591ff91 100644 --- a/wafo/misc.py +++ b/wafo/misc.py @@ -162,7 +162,7 @@ def piecewise(condlist, funclist, xi=None, fill_value=0.0, args=(), **kw): if len(condlist) == len(funclist)-1: condlist.append(otherwise_condition(condlist)) if xi is None: - arrays = condlist + arrays = () dtype = np.result_type(*funclist) else: if not isinstance(xi, tuple): @@ -170,7 +170,7 @@ def piecewise(condlist, funclist, xi=None, fill_value=0.0, args=(), **kw): arrays = np.broadcast_arrays(*xi) dtype = np.result_type(*arrays) - out = valarray(arrays[0].shape, fill_value, dtype) + out = valarray(condlist[0].shape, fill_value, dtype) for cond, func in zip(condlist, funclist): if isinstance(func, collections.Callable): temp = tuple(np.extract(cond, arr) for arr in arrays) + args