Package com.powsybl.iidm.import_
Class Importers
- java.lang.Object
-
- com.powsybl.iidm.import_.Importers
-
public final class Importers extends Object
A utility class to work with IIDM importers.- Author:
- Geoffroy Jamgotchian
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static DataSource
createDataSource(Path file)
static DataSource
createDataSource(Path directory, String fileNameOrBaseName)
static void
importAll(Path dir, Importer importer, boolean parallel, Consumer<Network> consumer)
static void
importAll(Path dir, Importer importer, boolean parallel, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
importAll(Path dir, Importer importer, boolean parallel, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener, Reporter reporter)
static Network
importData(ImportersLoader loader, String format, ReadOnlyDataSource dataSource, Properties parameters, ComputationManager computationManager, ImportConfig config)
static Network
importData(ImportersLoader loader, String format, ReadOnlyDataSource dataSource, Properties parameters, ComputationManager computationManager, ImportConfig config, Reporter reporter)
A convenient method to create a model from data in a given format.static Network
importData(String format, ReadOnlyDataSource dataSource, Properties parameters)
static Network
importData(String format, ReadOnlyDataSource dataSource, Properties parameters, Reporter reporter)
static Network
importData(String format, ReadOnlyDataSource dataSource, Properties parameters, ComputationManager computationManager)
static Network
importData(String format, ReadOnlyDataSource dataSource, Properties parameters, ComputationManager computationManager, Reporter reporter)
static Network
importData(String format, String directory, String baseName, Properties parameters)
A convenient method to create a model from data in a given format.static Network
loadNetwork(ReadOnlyDataSource dataSource)
static Network
loadNetwork(ReadOnlyDataSource dataSource, Properties properties)
static Network
loadNetwork(ReadOnlyDataSource dataSource, Properties properties, Reporter reporter)
static Network
loadNetwork(String file)
Loads a network from the specified file path, seeloadNetwork(Path)
.static Network
loadNetwork(String filename, InputStream data)
Loads a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services.static Network
loadNetwork(String filename, InputStream data, Reporter reporter)
Loads a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services.static Network
loadNetwork(String filename, InputStream data, ComputationManager computationManager)
Loads a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services.static Network
loadNetwork(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters)
Loads a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services.static Network
loadNetwork(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader)
Loads a network from a raw input stream, trying to guess the format from the specified filename.static Network
loadNetwork(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader, Reporter reporter)
Loads a network from a raw input stream, trying to guess the format from the specified filename.static Network
loadNetwork(Path file)
Loads a network from the specified file, trying to guess its format, and using importers and post processors defined as services.static Network
loadNetwork(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters)
Loads a network from the specified file, trying to guess its format, and using importers and post processors defined as services.static Network
loadNetwork(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader)
Loads a network from the specified file, trying to guess its format.static Network
loadNetwork(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader, Reporter reporter)
Loads a network from the specified file, trying to guess its format.static void
loadNetworks(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer)
static void
loadNetworks(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
loadNetworks(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
loadNetworks(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
loadNetworks(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
loadNetworks(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener, Reporter reporter)
static void
loadNetworks(Path dir, boolean parallel, Consumer<Network> consumer)
static void
loadNetworks(Path dir, boolean parallel, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener)
static void
loadNetworks(Path dir, Consumer<Network> consumer)
static Object
readParameter(String format, Properties parameters, Parameter configuredParameter)
Deprecated.UseParameter.read(String, Properties, Parameter)
insteadstatic Object
readParameter(String format, Properties parameters, Parameter configuredParameter, ParameterDefaultValueConfig defaultValueConfig)
Deprecated.
-
-
-
Method Detail
-
importData
public static Network importData(ImportersLoader loader, String format, ReadOnlyDataSource dataSource, Properties parameters, ComputationManager computationManager, ImportConfig config, Reporter reporter)
A convenient method to create a model from data in a given format.- Parameters:
format
- the import formatdataSource
- data sourceparameters
- some properties to configure the importcomputationManager
- computation manager to use for default post processorsconfig
- the import configurationreporter
- the reporter used for functional logs- Returns:
- the model
-
importData
public static Network importData(ImportersLoader loader, String format, ReadOnlyDataSource dataSource, Properties parameters, ComputationManager computationManager, ImportConfig config)
-
importData
public static Network importData(String format, ReadOnlyDataSource dataSource, Properties parameters, ComputationManager computationManager, Reporter reporter)
-
importData
public static Network importData(String format, ReadOnlyDataSource dataSource, Properties parameters, ComputationManager computationManager)
-
importData
public static Network importData(String format, ReadOnlyDataSource dataSource, Properties parameters, Reporter reporter)
-
importData
public static Network importData(String format, ReadOnlyDataSource dataSource, Properties parameters)
-
importData
public static Network importData(String format, String directory, String baseName, Properties parameters)
A convenient method to create a model from data in a given format.- Parameters:
format
- the import formatdirectory
- the directory where input files arebaseName
- a base name for all input filesparameters
- some properties to configure the import- Returns:
- the model
-
importAll
public static void importAll(Path dir, Importer importer, boolean parallel, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener, Reporter reporter) throws IOException, InterruptedException, ExecutionException
-
importAll
public static void importAll(Path dir, Importer importer, boolean parallel, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
importAll
public static void importAll(Path dir, Importer importer, boolean parallel, Consumer<Network> consumer) throws IOException, InterruptedException, ExecutionException
-
readParameter
@Deprecated public static Object readParameter(String format, Properties parameters, Parameter configuredParameter)
Deprecated.UseParameter.read(String, Properties, Parameter)
instead
-
readParameter
@Deprecated public static Object readParameter(String format, Properties parameters, Parameter configuredParameter, ParameterDefaultValueConfig defaultValueConfig)
Deprecated.
-
createDataSource
public static DataSource createDataSource(Path file)
-
createDataSource
public static DataSource createDataSource(Path directory, String fileNameOrBaseName)
-
loadNetwork
public static Network loadNetwork(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader, Reporter reporter)
Loads a network from the specified file, trying to guess its format.- Parameters:
file
- The file to be loaded.computationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parametersloader
- Provides the list of available importers and post-processorsreporter
- The reporter used for functional logs- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader)
Loads a network from the specified file, trying to guess its format.- Parameters:
file
- The file to be loaded.computationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parametersloader
- Provides the list of available importers and post-processors- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(Path file, ComputationManager computationManager, ImportConfig config, Properties parameters)
Loads a network from the specified file, trying to guess its format, and using importers and post processors defined as services.- Parameters:
file
- The file to be loaded.computationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parameters- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(Path file)
Loads a network from the specified file, trying to guess its format, and using importers and post processors defined as services. Import will be performed using import configuration defined in default platform config, and with no importer-specific parameters. Post processors will use the defaultLocalComputationManager
, as defined in default platform config.- Parameters:
file
- The file to be loaded.- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(String file)
Loads a network from the specified file path, seeloadNetwork(Path)
.- Parameters:
file
- The file to be loaded.- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader, Reporter reporter)
Loads a network from a raw input stream, trying to guess the format from the specified filename. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedcomputationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parametersloader
- Provides the list of available importers and post-processorsreporter
- The reporter used for functional logs- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters, ImportersLoader loader)
Loads a network from a raw input stream, trying to guess the format from the specified filename. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedcomputationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parametersloader
- Provides the list of available importers and post-processors- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(String filename, InputStream data, ComputationManager computationManager, ImportConfig config, Properties parameters)
Loads a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedcomputationManager
- A computation manager which may be used by import post-processorsconfig
- The import config, in particular definition of post processorsparameters
- Import-specific parameters- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(String filename, InputStream data, ComputationManager computationManager)
Loads a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services. Import will be performed using import configuration defined in default platform config, and with no importer-specific parameters. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedcomputationManager
- A computation manager which may be used by import post-processors- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(String filename, InputStream data)
Loads a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services. Import will be performed using import configuration defined in default platform config, and with no importer-specific parameters. Post processors will use the defaultLocalComputationManager
, as defined in default platform config. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loaded- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(String filename, InputStream data, Reporter reporter)
Loads a network from a raw input stream, trying to guess the format from the specified filename, and using importers and post processors defined as services. Import will be performed using import configuration defined in default platform config, and with no importer-specific parameters. Post processors will use the defaultLocalComputationManager
, as defined in default platform config. Please note that the input stream must be from a simple file, not a zipped one.- Parameters:
filename
- The name of the file to be imported.data
- The raw data from which the network should be loadedreporter
- The reporter used for functional logs- Returns:
- The loaded network
-
loadNetwork
public static Network loadNetwork(ReadOnlyDataSource dataSource)
-
loadNetwork
public static Network loadNetwork(ReadOnlyDataSource dataSource, Properties properties)
-
loadNetwork
public static Network loadNetwork(ReadOnlyDataSource dataSource, Properties properties, Reporter reporter)
-
loadNetworks
public static void loadNetworks(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener, Reporter reporter) throws IOException, InterruptedException, ExecutionException
-
loadNetworks
public static void loadNetworks(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
loadNetworks
public static void loadNetworks(Path dir, boolean parallel, ImportersLoader loader, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
loadNetworks
public static void loadNetworks(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Properties parameters, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
loadNetworks
public static void loadNetworks(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
loadNetworks
public static void loadNetworks(Path dir, boolean parallel, ComputationManager computationManager, ImportConfig config, Consumer<Network> consumer) throws IOException, InterruptedException, ExecutionException
-
loadNetworks
public static void loadNetworks(Path dir, boolean parallel, Consumer<Network> consumer) throws IOException, InterruptedException, ExecutionException
-
loadNetworks
public static void loadNetworks(Path dir, boolean parallel, Consumer<Network> consumer, Consumer<ReadOnlyDataSource> listener) throws IOException, InterruptedException, ExecutionException
-
loadNetworks
public static void loadNetworks(Path dir, Consumer<Network> consumer) throws IOException, InterruptedException, ExecutionException
-
-