-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Labels
featureNew feature or requestNew feature or request
Description
Intention
When we have the calculation results, it is in a numpy structured array. For example for the node you have:
Input
id u_pu ...
7 1.05 ...
10 1.07 ...
8 1.07 ...
103 1.0 ...
Say we want to retrieve a sub-array with node id 10 and 103. To do this, we need to translate the list of id's to list of position numbers in the original numpy array. The C++ core already has hash table to do the lookup.
API
Say we have a numpy array a = [10, 103]. We should be able to retrieve the position number by using the following call:
position = model.get_indexer('node', a)The returned value should be [1, 3].
We can then for example to retrieve the u_pu for these two nodes by:
u_pu_sub_array = node_result['u_pu'][position]The result u_pu_sub_array should be [1.07, 1.0]
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or request