OpenSSF silver badge: minor refactor C API implementation#1269
OpenSSF silver badge: minor refactor C API implementation#1269TonyXiang8787 merged 3 commits intomainfrom
Conversation
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
There was a problem hiding this comment.
Since we are here, please fix the additional problems in the dataset pointer check. Namely for the attribute pointers.
power-grid-model/power_grid_model_c/power_grid_model_c/src/dataset.cpp
Lines 131 to 137 in b951eff
power-grid-model/power_grid_model_c/power_grid_model_c/src/dataset.cpp
Lines 165 to 171 in b951eff
power-grid-model/power_grid_model_c/power_grid_model_c/src/dataset.cpp
Lines 197 to 203 in b951eff
These data pointers should be allowed to be nullptr, if the total number of the elements in the component is zero. Users may still create such an attribute buffer (e.g. empyt vector or empty span, or empty numpy array) in an automatic way. But the data pointer maybe nullptr which is well defined.
i am implementing that as we speak but it is something we really want to allow? |
…disallowed Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
|



Cherry-picked changes from #1264
Re-opened a new PR as #1264 was superceded by #1266.
This PR is also rebased off
mainrather than #1241 to allow easier development.