def bounds(self, value): self._bounds = get_none_or_2d(value) if self._bounds is not None and self._original_units is not None: are_units_equal = get_are_units_equal((self.units, self._original_units)) if not are_units_equal: self._bounds = get_conformed_units(self._bounds, self._original_units, self.conform_units_to) if value is not None: self._validate_bounds_()
def get_none_or_array(arr, ndim, masked=False): if ndim == 1: ret = get_none_or_1d(arr) elif ndim == 2: ret = get_none_or_2d(arr) else: raise NotImplementedError if ret is not None and masked and not isinstance(ret, np.ma.MaskedArray): ret = np.ma.array(ret, mask=False) return ret
def _get_none_or_array_(self,arr,masked=False): if self._ndims == 1: ret = get_none_or_1d(arr) elif self._ndims == 2: ret = get_none_or_2d(arr) else: raise(NotImplementedError) if ret is not None and masked and not isinstance(ret,np.ma.MaskedArray): ret = np.ma.array(ret,mask=False) return(ret)
def bounds(self,value): self._bounds = get_none_or_2d(value) if value is not None: self._validate_bounds_()
def bounds(self, value): # set the bounds variable. self._bounds = get_none_or_2d(value) # validate the value if value is not None: self._validate_bounds_()