[params] indexing with boolean arrays switched off, rases proper error now

This commit is contained in:
Max Zwiessele 2014-05-12 16:23:01 +01:00
parent c8da9602ec
commit 8531c4bff0

View file

@ -137,6 +137,8 @@ class Param(OptimizationHandlable, ObsAr):
slice_index = self._current_slice_
def f(a):
a, b = a
if isinstance(a, numpy.ndarray) and a.dtype == bool:
raise ValueError, "Boolean indexing not implemented, use Param[np.where(index)] to index by boolean arrays!"
if a not in (slice(None), Ellipsis):
if isinstance(a, slice):
start, stop, step = a.indices(b)