-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create mixins for common methods #129
Comments
@DaniBodor In different variants, data is stored in differently named attributes. E.g. EITDataVariant has an attribute
class EITDataVariant(Variant):
pixel_impedance: NDArray
@property
def _data_storage(self) -> NDarray:
return self.pixel_impedance What do you think? I think the last option is the neatest. |
I think class EITDataVariant:
def __len__(self) -> int:
return self.pixel_impedance.shape[0] This requires a uniform way to access the proper attribute; see previous comment. |
Thanks for sharing these considerations. I'm not sure what I prefer at this point, as it's still a bit abstract for me. I will think about it and play with it as I start implementing it and get back to you with my thoughts then. |
OK, I now have a better understanding of the overall structure. Do I understand correctly that any If not, then I'm not sure there's a neat unified way to do concatenation, and we may as well stick to separate methods for each. |
Make mix-in classes for:
__len__
__eq__
andcheck_equivalence
: mixin class for equality and equivalence #133np.nan != np.nan
(but should not fail equality) and thatNDarray
s need to be checked for shape and all entries.The more I think about this, the more I feel like it would make sense to have a super-class with all these methods, rather than a whole bunch of mixins. To me, mixins make sense if we want to pick and choose which class uses which of these functionalities, but it seems to me that all classes will use all the methods.
Anyway, for now I will create them as mixins and then it should be fairly straightforward to refactor it into a superclass if we decide to go that route.
The text was updated successfully, but these errors were encountered: