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

Add new overload for loadNetwork and improve code in Importers #1986

Merged
merged 4 commits into from
Mar 1, 2022

Conversation

miovd
Copy link
Contributor

@miovd miovd commented Feb 22, 2022

Signed-off-by: VEDELAGO MIORA miora.ralambotiana@rte-france.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
No

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature : Add some overload of Importers.loadNetwork which allows ReadOnlyDataSource as parameter

  • some code improvements

Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
No

@miovd miovd changed the title [WIP] Add new overload for loadNetwork and improve code in Importers Add new overload for loadNetwork and improve code in Importers Feb 25, 2022
Signed-off-by: VEDELAGO MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: VEDELAGO MIORA <miora.ralambotiana@rte-france.com>
Signed-off-by: VEDELAGO MIORA <miora.ralambotiana@rte-france.com>
@miovd miovd force-pushed the add_improve_importers branch from 3ce7647 to 70c9529 Compare February 25, 2022 13:38
public void importData() {
Network network = Importers.importData(loader, TEST_FORMAT, null, null, computationManager, importConfigMock);
public void importData() throws IOException {
Network network = Importers.loadNetwork((ReadOnlyDataSource) null);
Copy link
Member

@geofjamg geofjamg Feb 28, 2022

Choose a reason for hiding this comment

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

Probably has nothing to do with this PR, but what is the purpose of this test?????
Why are we allowing a null data source and then check that with a mock importer, we have succeed to import a network?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe it would worth a fix but could be done in another PR, as you wish

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it was to test if the importer was found in the LOADER and not the importer itself (it tests the mechanisms to find an importer).

Copy link
Member

@geofjamg geofjamg Mar 1, 2022

Choose a reason for hiding this comment

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

I think it was to test if the importer was found in the LOADER and not the importer itself (it tests the mechanisms to find an importer).

In any case null datasource should throw an exception even in such a test

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm writing an issue about it

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

84.6% 84.6% Coverage
0.0% 0.0% Duplication

@miovd miovd merged commit 8e4dff4 into main Mar 1, 2022
@miovd miovd deleted the add_improve_importers branch March 1, 2022 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants