-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Create network elements by dataframe #127
Conversation
tests/test.py
Outdated
@@ -32,6 +32,13 @@ def test_run_lf(self): | |||
results = pp.loadflow.run_dc(n, parameters) | |||
self.assertEqual(1, len(results)) | |||
|
|||
def test_new_load(self): | |||
n = pp.network.create_eurostag_tutorial_example1_network() | |||
n.new_load('VLLOAD', 'LOAD2', double_map={"p0" : 1.1, "q0" : 2.1}, str_map={'connectable_bus':'NLOAD', 'bus': 'NLOAD'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not doing it using a dataframe update? that would be more consistent with what has already been done.
cpp/src/pypowsybl.cpp
Outdated
@@ -418,6 +418,19 @@ void updateNetworkElementsWithStringSeries(void* network, element_type elementTy | |||
idPtr.get(), valuePtr.get(), elementCount); | |||
} | |||
|
|||
void newElement(void* network, const std::string& id, element_type elementType, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yichen88 have you tried to create Series from Python side instead of having all theses maps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we add elements, we need a ROW
of data to build an equipment together, we can not do with COLUMN'
in Series.
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
Kudos, SonarCloud Quality Gate passed! |
About scope of that evolution: Then we will have a design question for elements with "nested" elements, such as transformers and tap changer steps, or shunts and shunts models. They cannot be represented as a single dataframe. A possibility would be to be able to pass multiple dataframes : for example 1 for transformers data and 1 for the corresponding steps data. |
We will need to refactor a little how data is provided from python to java, based on the work on #234 . As for the element updates, we should now transfer the whole dataframe at once. |
Will be merged with / refactored in #259 |
Signed-off-by: yichen88 tang.yichenyves@gmail.com
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restWhat kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)