brisvag / blik

Python tool for visualising and interacting with cryo-ET and subtomogram averaging data.

Home Page:https://brisvag.github.io/blik/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sub-peepers and their methods: abstract classes?

brisvag opened this issue · comments

I think that with out current idea of sub-Peepers, there would be quite a bit of code duplication, or weird inheritance networks.

What do you think of having a few abstract classes with topic-specific methods, and then our peepers could inherit from any combination of those, while adding whatever connection is needed?

For example, particle-related operations would be in one of these abstract classes. Then, a Peeper used for just particles can use them, as well as a RefinementPeeper that would also inherit from an image-related abstract class. this woudl allow the 2 peeper to reuse code, while having (for example) different constructor for easier creation.

I'm not so sure anymore about this. The more I play around with the idea, and the more I get convinced that everything should be available in Peeper, so that if any data is added, no matter how you started you will be able to handle it.

We should probably set up a bit better the io_ module and have an all-encompassing read function (probably with modes) so that creating a peeper is seamless. this can probably be accessed by the peeper with an add_data() method, so that i can be used on init as well as later on.

As for everything else (displaying, analysis...), we should probably put everything in a generic peeper.

I agree until the last point: I think it's strange and unintuitive that the object you're holding only differs in construction methods.
I would go with something like numpy's np.array(), which "alsways" spitsout a ndarray and it's only job is to guess from the input how to construct it.

Obsolete/closed by #68 .