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

ODRE import postprocessor fixes #3080

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

ODRE import postprocessor fixes #3080

wants to merge 17 commits into from

Conversation

flo-dup
Copy link
Contributor

@flo-dup flo-dup commented Jun 24, 2024

Please check if the PR fulfills these requirements

  • 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?
No

What kind of change does this PR introduce?
Cleaning post processor code

What is the current behavior?

  • 40s on my laptop to import all the lines & substations positions
  • 3 graph traversals for each line
  • coordinates duplicated if same line reference twice with code_ligne_x and code_ligne_y
  • code duplication
  • substations read twice

What is the new behavior (if this is a feature change)?

  • 5s on my laptop to import all the lines & substations positions
  • graph not created if only one entry
  • one single graph traversal for each problematic line
  • coordinates not duplicated if same line reference twice with code_ligne_x and code_ligne_y
  • code factorization
  • substations read once

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
boolean aerialLinesPresent = Files.exists(aerialLinesFilePath);
boolean undergroundLinesPresent = Files.exists(undergroundLinesFilePath);
if (aerialLinesPresent && undergroundLinesPresent) {
OdreGeoDataAdder.fillNetworkLinesGeoDataFromFiles(network,
aerialLinesFilePath, undergroundLinesFilePath, substationsFilePath, odreConfig);
} else {
OdreGeoDataAdder.fillNetworkSubstationsGeoDataFromFile(network, substationsFilePath, odreConfig);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you move this line here, substation geo data are not added when there are aerial or underground lines (but they are indeed read by fillNetworkLinesGeoDataFromFiles).
This explains the test failure.

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
Copy link

sonarcloud bot commented Aug 8, 2024

Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
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

2 participants