Skip to content

Commit

Permalink
Add all parameters network read method from a data source (#3150)
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
  • Loading branch information
geofjamg authored Sep 23, 2024
1 parent 20a2638 commit 0382d34
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,16 @@ static Network read(ReadOnlyDataSource dataSource, Properties properties) {
return read(dataSource, properties, ReportNode.NO_OP);
}

static Network read(ReadOnlyDataSource dataSource, Properties properties, ReportNode reportNode) {
Importer importer = Importer.find(dataSource);
static Network read(ReadOnlyDataSource dataSource, Properties parameters, ReportNode reportNode) {
return read(dataSource, LocalComputationManager.getDefault(), ImportConfig.load(), parameters, NetworkFactory.findDefault(),
new ImportersServiceLoader(), reportNode);
}

static Network read(ReadOnlyDataSource dataSource, ComputationManager computationManager, ImportConfig config, Properties parameters,
NetworkFactory networkFactory, ImportersLoader loader, ReportNode reportNode) {
Importer importer = Importer.find(dataSource, loader, computationManager, config);
if (importer != null) {
return importer.importData(dataSource, NetworkFactory.findDefault(), properties, reportNode);
return importer.importData(dataSource, networkFactory, parameters, reportNode);
}
throw new PowsyblException(Importers.UNSUPPORTED_FILE_FORMAT_OR_INVALID_FILE);
}
Expand Down

0 comments on commit 0382d34

Please sign in to comment.