PowerGridModel / power-grid-model

Python/C++ library for distribution power system analysis
Mozilla Public License 2.0
143 stars 30 forks source link

[FEATURE] Output buffer size/shape check #722

Open Jerry-Jinfeng-Guo opened 2 weeks ago

Jerry-Jinfeng-Guo commented 2 weeks ago

Issue

When adding a buffer to output dataset during batch calculations, users can misuse/abuse the fact that there is no additional check between the user indicated output shape and the actual output shape. For example, in a pf calculation for 10 nodes with batch size 4, the user can add a buffer of 1x10, instead of 4x10. In return, only the first 10 nodes (from the first batch) will be filled to the buffer.

Possible solution

In the main core, functionalities should be put in place to verify whether both shapes match. In case of a smaller buffer being provided, warnings should be given clearly stating that the output result is in-complete. In the case of the opposite, message should be communicated accordingly that provided buffer is more than necessary.