From a29cf87e53b28864381edaca71355c10dee64512 Mon Sep 17 00:00:00 2001 From: Max Zwiessele Date: Wed, 12 Feb 2014 11:31:12 +0000 Subject: [PATCH] deleted listarray --- GPy/core/parameterization/array_core.py | 15 +-------------- GPy/core/parameterization/param.py | 4 +--- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/GPy/core/parameterization/array_core.py b/GPy/core/parameterization/array_core.py index 1d300d80..dba813a5 100644 --- a/GPy/core/parameterization/array_core.py +++ b/GPy/core/parameterization/array_core.py @@ -6,19 +6,6 @@ __updated__ = '2013-12-16' import numpy as np from parameter_core import Observable -class ListArray(np.ndarray): - """ - ndarray which can be stored in lists and checked if it is in. - WARNING: This overrides the functionality of x==y!!! - Use numpy.equal(x,y) for element-wise equality testing. - """ - - def __new__(cls, input_array): - obj = np.asanyarray(input_array).view(cls) - return obj - #def __eq__(self, other): - # return other is self - class ParamList(list): def __contains__(self, other): @@ -29,7 +16,7 @@ class ParamList(list): pass -class ObservableArray(ListArray, Observable): +class ObservableArray(np.ndarray, Observable): """ An ndarray which reports changes to its observers. The observers can add themselves with a callable, which diff --git a/GPy/core/parameterization/param.py b/GPy/core/parameterization/param.py index b76b3858..5d987ae6 100644 --- a/GPy/core/parameterization/param.py +++ b/GPy/core/parameterization/param.py @@ -46,6 +46,7 @@ class Param(ObservableArray, Constrainable, Gradcheckable): """ __array_priority__ = -1 # Never give back Param _fixes_ = None + _parameters_ = [] def __new__(cls, name, input_array, default_constraint=None): obj = numpy.atleast_1d(super(Param, cls).__new__(cls, input_array=input_array)) obj._current_slice_ = (slice(obj.shape[0]),) @@ -144,9 +145,6 @@ class Param(ObservableArray, Constrainable, Gradcheckable): # from_name = self.name # self.name = new_name # self._direct_parent_._name_changed(self, from_name) - @property - def _parameters_(self): - return [] def _collect_gradient(self, target): target[:] = self.gradient.flat #===========================================================================