From 4886dfde08218e1a013ff50b6adf6e8341d9c33c Mon Sep 17 00:00:00 2001 From: mzwiessele Date: Thu, 4 Sep 2014 18:01:33 +0100 Subject: [PATCH] [indexing] maybe? cannot tell, tests are broken --- GPy/core/parameterization/param.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/GPy/core/parameterization/param.py b/GPy/core/parameterization/param.py index ff8cc638..eed18bea 100644 --- a/GPy/core/parameterization/param.py +++ b/GPy/core/parameterization/param.py @@ -246,9 +246,18 @@ class Param(Parameterizable, ObsAr): # get a int-array containing all indices in the first axis. if slice_index is None: slice_index = self._current_slice_ - indices = np.indices(self._realshape_, dtype=int) - indices = indices[(slice(None),)+slice_index] - indices = np.rollaxis(indices, 0, indices.ndim) + try: + indices = np.indices(self._realshape_, dtype=int) + indices = indices[(slice(None),)+slice_index] + indices = np.rollaxis(indices, 0, indices.ndim).reshape(-1,2) + #print indices_ + #if not np.all(indices==indices__): + # import ipdb; ipdb.set_trace() + except: + print "Warning: extended indexing was used" + indices = np.indices(self._realshape_, dtype=int) + indices = indices[(slice(None),)+slice_index] + indices = np.rollaxis(indices, 0, indices.ndim) return indices def _max_len_names(self, gen, header): gen = map(lambda x: " ".join(map(str, x)), gen)