pandapipes
pandapipes copied to clipboard
Bug in branch result extraction?
It seems to me that there are three main problems in the result extraction of branch models:
- Almost all concrete branch components use the
super()
-call to the branch model's most generalextract_results()
implementation. There, however, it is always assumed that we deal with a branch component with internal nodes. This is quite confusing and can be inefficient, since we don't need many of the calculations (especially _sum_by_group) for any component without internal nodes. - Many concrete classes are supposed to add more table entries, but often they repeat large parts of the calculations done in the branch base class.
- If we add other components, the result tables might again differ, so why are the current res_table entries set to the ones calculated in the branch component models?
Since this only causes headaches when creating new components and leads to efficiency issues, it it not a real bug, but it should definitely be changed.
I think, we should agree on a different way of how to generalize the branch result extraction, and probably write one or more external functions (add them to the component toolbox), which can be called from within the component classes.
I found another error, which I thought had been tackled already, but it seems that I was wrong:
When using internal nodes, the v_from and v_to should not be considered as a sum of all internal v_from and v_to values, but only for the single outlying nodes.