Currently, SDECPlotter has two public methods generate_plot_mpl & generate_plot_ply that can be tested. But other methods (that are private and are called by these two) can't be unit-tested because they need to read those attributes of instance that were written by the caller method. And the whole function callstack follows same fashion of reading/writing data from/to instance attributes making each method difficult to test independently - e.g. of one such callstack (top level method calling lower level method):
generate_plot_mpl()
_calculate_plotting_data()
_calculate_emission_lumniosities()
_calculate_absorption_luminosities()
_calculate_photosphere_luminosity()
_show_colorbar_mpl()
_make_colorbar_labels()
The class (or whole module if required) should be restructured in a way to make these private methods more atomic in their operations (instead of changing class state too much) so that they can be unit-tested.
Currently, SDECPlotter has two public methods
generate_plot_mpl
&generate_plot_ply
that can be tested. But other methods (that are private and are called by these two) can't be unit-tested because they need to read those attributes of instance that were written by the caller method. And the whole function callstack follows same fashion of reading/writing data from/to instance attributes making each method difficult to test independently - e.g. of one such callstack (top level method calling lower level method):The class (or whole module if required) should be restructured in a way to make these private methods more atomic in their operations (instead of changing class state too much) so that they can be unit-tested.