pandapipes icon indicating copy to clipboard operation
pandapipes copied to clipboard

Bug in branch result extraction?

Open dlohmeier opened this issue 2 years ago • 1 comments

It seems to me that there are three main problems in the result extraction of branch models:

  1. Almost all concrete branch components use the super()-call to the branch model's most general extract_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.
  2. 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.
  3. 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.

dlohmeier avatar Jan 21 '22 08:01 dlohmeier