Skip to content
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

Closed
wants to merge 18 commits into from
Closed

Conversation

yichen88
Copy link
Contributor

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)

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem ? If so, link to this issue using '#XXX' and skip the rest

What 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:

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Other information:

(if any of the questions/checkboxes don't apply, please delete them entirely)

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'})
Copy link
Member

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.

@@ -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,
Copy link
Member

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?

Copy link
Contributor Author

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>
@yichen88 yichen88 changed the title new load method [WIP] Add equipment by dataframe Jun 28, 2021
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>
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
Signed-off-by: yichen88 <tang.yichenyves@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 5, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

86.0% 86.0% Coverage
0.0% 0.0% Duplication

@sylvlecl
Copy link
Contributor

About scope of that evolution:
we can start with a first evolution with only generators and loads (which already have use cases).

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.

@sylvlecl
Copy link
Contributor

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.

@sylvlecl sylvlecl changed the title [WIP] Add equipment by dataframe [WIP] Create network elements by dataframe Oct 13, 2021
@sylvlecl
Copy link
Contributor

Will be merged with / refactored in #259

@sylvlecl sylvlecl closed this Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants