powsybl / powsybl-core

A framework to build power system oriented software
https://www.powsybl.org
Mozilla Public License 2.0
124 stars 40 forks source link

ReportNode delayed creation/deletion #3071

Open flo-dup opened 3 months ago

flo-dup commented 3 months ago

Describe the current behavior

Currently, if a ReportNode is created, we cannot easily delay its creation (especially if we want to add children to it).

Describe the expected behavior

Enrich the ReportNode API to be able to create or not (/to remove or not?) a reportNode based on some future results

Describe the motivation

Due to previous Reporter API design, the current use of ReportNode is sometimes to group other ReportNode without any functional added value (message "Invalidation warnings:" for instance). Besides, there is still a lot of functional information which is not reported. These two matters lead to "title" reports without children. This kind of node decreases final readability, see issue #2192.

Another use case, introduced in powsybl/powsybl-open-loadflow#919: some users sometimes need to pile up reportNodes (which may have children themselves) and then include them or not. Currently this can be done by creating each time a new root reportNode, and then include it or not depending on some result.

Extra Information

No response