As a biologist, I often write python software to do some data analysis. The general structure is always:
There is data to download , do the analysis (statistics, clustering ...), and then visualize the results.
Sometimes for the same experiment, the data can come in different formats, you can have different methods for their analysis and possible visualization, which might or may not depend on the analysis.
I'm struggling to find a common โpythonicโ and object-oriented way to make it understandable and easily extensible. It should be easy to add a new type of action or make small options for existing ones, so I'm pretty sure I have to do this with oop.
I already made a Data object with experimental data loading methods. I plan to create an inherited class if I have multiple data sources to override the load function.
After that ... I'm not sure. Do I have to run an abstract Analysis class with a child class for each type of analysis (and use their attributes to store the results) and do the same for visualization using a shared Experiment object containing a Data instance and several Analysis and Visualization instances? Or should visualizations be functions that take an analysis object and / or data as parameter (s) for plotting? Is there a more efficient way? Did I miss something?
python oop scientific-computing
Geeklhem
source share