From 219961646fd404bb0d1164622b99bcff120ea5ab Mon Sep 17 00:00:00 2001 From: Gerd Duscher <50049264+gduscher@users.noreply.github.com> Date: Sun, 15 Dec 2024 18:37:35 -0500 Subject: [PATCH] Update dimension.py --- sidpy/sid/dimension.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sidpy/sid/dimension.py b/sidpy/sid/dimension.py index b96ff2cf..777bdc57 100644 --- a/sidpy/sid/dimension.py +++ b/sidpy/sid/dimension.py @@ -102,10 +102,12 @@ def __array_finalize__(self, obj): def __array_wrap__(self, out_arr, context=None): # just call the parent - super(Dimension, self).values.__array_wrap__(self, out_arr, context) + values = super(Dimension, self).__array_wrap__(self, out_arr, context) + new_dim = Dimension(values, name=self.name, quantity=self.quantity, units=self.units) # return correct values - return out_arr - + return new_dim + + def __repr__(self): return '{}: {} ({}) of size {}'.format(self.name, self.quantity, self.units, self.shape)