Skip to content

Draft: three seperate calculate functions

Fredrik Nilsson requested to merge WCalculator_refactor_calculate_and_ppa into master

Related to !1547 (merged)

Closes #724 (closed)

When we discussed !1547 (merged) we concluded that the PPACalculator and WCalculator need to have different names from their respective .calculate() functions. Since these functions are the only thing that differs between the two classes I see no need to have them as two separate classes. Rather it seems reasonable to have a single Calculator class that has two separate functions. I also separate the output_dist to two separate functions, since this reduced the number of lines in the code and forces the user to have a more conscious programming style. So now we have

.calculate_W_WgG() .calculate_W_wGG() and .calculate_W_ppa().

Since the output arrays in general are different for all these functions it seems reasonable that they should be calculated in three different functions rather than having one function whose output type and dimensions depend on the input arguments.

Edited by Fredrik Nilsson

Merge request reports