Open murgeyseb opened 4 years ago
Do we need to add a Property "provider" to the exporter to let the prossibility to change it ?
@murgeyseb How should we implement this?
Do we add a property to the UCTEExporter to give the name of the implementation (that overrides the config.yml file), like it's possible with the naming strategy?
Do we introduce export post-processor mechanism: a groovy script could be executed just after the conversion IIDM -> UCTE based on two binded variables (network and ucteNetwork)? This one is very flexible.
The second possibility could be really nice for other purpose too. If it is possible it would be the prefered solution on my side.
@jlabous I will try to explain you what we expect as a UCTE export post-processor:
Post-processors is a concept that already exists in powsybl. It's mainly used to complete the conversion of a grid from a format to IIDM. The idea there, is to provide the same kind of mechanism for the UCTE export. I propose to add a UcteExportPostProcessor
interface and an implementation based on a groovy script so that @murgeyseb could update the header of the UCTE network just before its export.
The interface looks like this:
public interface UcteExportPostProcessor {
public String getName();
public void process(Network network, UcteNetwork ucteNetwork);
}
The groovy implementation should look like the GroovyScriptPostProcessor
. You have to bind both the network and the ucteNetwork, and execute the script:
@Override
public void process(Network network, UcteNetwork ucteNetwork) throws Exception {
if (Files.exists(script)) {
LOGGER.debug("Execute groovy post processor {}", script);
try (Reader reader = Files.newBufferedReader(script, StandardCharsets.UTF_8)) {
CompilerConfiguration conf = new CompilerConfiguration();
Binding binding = new Binding();
binding.setVariable("network", network);
binding.setVariable("ucteNetwork", ucteNetwork);
GroovyShell shell = new GroovyShell(binding, conf);
shell.evaluate(reader);
}
}
}
Do you want to request a feature or report a bug? Feature
What is the current behavior? UCTE exporter generate a UCTE file containing no file description in the generated comment header. However, ENTSO-E quality of data sets and calculations says (page 7 of the document https://docstore.entsoe.eu/Documents/Publications/SOC/Continental_Europe/150420_quality_of_datasets_and_calculations_3rd_edition.pdf):
Though it is important that a PowSyBl user can add a comment in the header part of UCTE file exported to define the provider of the file.
What is the expected behavior? UcteExporter should give the user the possibility of setting a comment for the generated file (via network property, exporter property, or any relevant combination of these).
What is the motivation / use case for changing the behavior? Generate UCTE files of industrial quality.