should negative indices be allowed ? #2650
heckstrahler
started this conversation in
General
Replies: 2 comments
-
|
changed dtypes to unsigned, creates problems with powerflow tests, reason currently not clear |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
should we use numpy dtypes or pandas dtypes |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Pandapower tries to minimize memory usage by setting the dtype of pandas columns with values >=0 to unsigned integers.
However, for example it is still possible to create buses with negative indices by forcing the index via a parameter of the create function.
If an element is then created at such a bus, the column which should by dtype only contain unsigned integers now contains a negative number and the dtype of the column is not unsigned anymore, therefore negating any potential memory savings.
The create functions for buses should not allow the creating of buses with negative indices. A solution could be the handle negative index parameter the same as if the index already exists: Create the bus at the next higher free index.
Additionally the type on the index in each dataframe could warrant some discussion for potential memory savings.
Beta Was this translation helpful? Give feedback.
All reactions