Skip to content

Commit 4a4f6a9

Browse files
ChamseddineBhdmiovd
authored andcommitted
iidm new import/export modes (#46)
1 parent 66d7997 commit 4a4f6a9

File tree

2 files changed

+64
-4
lines changed

2 files changed

+64
-4
lines changed

docs/iidm/exporter/iidm.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ For more information about the IIDM model, see [here](../model/index.md).
1111

1212
IIDM networks can be serialized in XML files. The IIDM exporter generates files with a `*.xiidm` extension.
1313

14+
The IIDM exporter has three exporting modes:
15+
16+
- **First mode**: Exports the network and its extensions in a unique file.
17+
18+
- **Second mode**: Exports the network in a file and the extensions in another file.
19+
20+
- **Third mode**: Exports the network in a file and each extension type in a separate file.
21+
1422
# Example
1523
```xml
1624
<?xml version="1.0" encoding="UTF-8"?>
@@ -78,10 +86,6 @@ of the network or not. Its default value is `false`.
7886
The `iidm.export.xml.anonymised` property is an optional property that defines if the XIIDM exporter anonymises
7987
all equipments in the generated file or not. Its default value is `false`.
8088

81-
## iidm.export.xml.skip-extensions
82-
The `iidm.export.xml.skip-extensions` property is an optional property that defines if the XIIDM exporter skips exporting the
83-
network extensions or not. Its default value is `false`.
84-
8589
## iidm.export.xml.topology-level
8690
The `iidm.export.xml.topology-level` property is an optional property that defines if the most detailed topology in which the XIIDM exporter can export the
8791
network. Its default value is `NODE_BREAKER`.
@@ -90,6 +94,32 @@ network. Its default value is `NODE_BREAKER`.
9094
The `iidm.export.xml.throw-exception-if-extension-not-found` property is an optional property that defines if the XIIDM exporter throws
9195
an exception if the network contains an unknown or unserializable extension or if it just ignores it. Its default value is `false`.
9296

97+
## iidm.export.xml.export-mode
98+
The `iidm.export.xml.export-mode` property is an optional property that defines the export mode of the XIIDM exporter.
99+
The export mode can be:
100+
101+
- `IidmImportExportMode.UNIQUE_FILE`: in case we want to export the network and its extensions in a unique file.
102+
103+
- `IidmImportExportMode.EXTENSIONS_IN_ONE_SEPARATED_FILE`: in case we want to export the network in a file and the extensions in a separate file.
104+
Example: if our network `test` has extensions then the network will be exported in the `test.xiidm` file when all its extensions will be exported in `test-ext.xiidm` file.
105+
106+
- `IidmImportExportMode.ONE_SEPARATED_FILE_PER_EXTENSION_TYPE`: in case we want to export network in a file and each extension type in a separate file.
107+
Example: if our network `test` has two extensions `loadFoo` and `loadBar` then the network will be exported
108+
in the `test.xiidm` file when `loadFoo` and `loadBar` will be exported respectively in `test-loadFoo.xiidm` and `test-loadBar.xiidm`.
109+
110+
The default value for this parameter is `IidmImportExportMode.NO_SEPARATED_FILE_FOR_EXTENSIONS`.
111+
112+
## iidm.export.xml.extensions
113+
The `iidm.export.xml.extensions` property is an optional property that defines the list of extensions that we want to export by the XIIDM exporter.
114+
By default all extensions will be exported.
115+
116+
# Deprecated configuration properties for IIDM-XML exporter
117+
118+
## iidm.export.xml.skip-extensions
119+
The `iidm.export.xml.skip-extensions` property is an optional property that defines if the XIIDM exporter skips exporting the
120+
network extensions or not. Its default value is `false`.
121+
This property is deprecated since v2.4.0. Use the `iidm.export.xml.export-mode` property instead.
122+
93123
# Maven configuration
94124
To support IIDM-XML files, add the following dependencies to the `pom.xml` file.
95125
```xml

docs/iidm/importer/iidm.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ For more information about the IIDM model, see [here](../model/index.md).
1212
IIDM networks can be serialized in XML files. The IIDM importer supports files with the following extensions: `*.xml`,
1313
`*.xiidm` and `*.iidm`.
1414

15+
The IIDM importer has three importing modes:
16+
17+
- **First mode** : Imports the network and its extensions from a unique file.
18+
19+
- **Second mode** : Imports the network from a file and the extensions from another file.
20+
21+
- **Third mode** : Imports the network from a file and each extension type from a separate file.
22+
1523
# Example
1624
```xml
1725
<?xml version="1.0" encoding="UTF-8"?>
@@ -68,6 +76,28 @@ The `iidm.import.xml.throw-exception-if-extension-not-found` property is an opti
6876
that defines if the XIIDM importer throws an exception while trying to import an unknown or undeserializable extension or if
6977
it just ignores it. Its default value is `false`.
7078

79+
80+
## iidm.import.xml.import-mode
81+
The `iidm.import.xml.import-mode` property is an optional property
82+
that defines the import mode of the XIIDM importer.
83+
84+
Its possible values are :
85+
86+
- `IidmImportExportMode.UNIQUE_FILE`: Imports the network and its extensions from a unique file.
87+
88+
- `IidmImportExportMode.EXTENSIONS_IN_ONE_SEPARATED_FILE`: Imports the network from a file and the extensions from another file.
89+
In this case if the network file name is network.xiidm, the extensions file name must be network-ext.xiidm.
90+
91+
- `IidmImportExportMode.ONE_SEPARATED_FILE_PER_EXTENSION_TYPE`: Imports the network from a file and each extension type from a separate file.
92+
In this mode each extension file name must be networkName-extensionName.xiidm.
93+
Example : if we have an extension file for the `loadFoo` extension type and our network name is `test`, the file name must be `test-loadFoo.xiidm`.
94+
95+
The default value of this parameter is `IidmImportExportMode.NO_SEPARATED_FILE_FOR_EXTENSIONS`.
96+
97+
## iidm.import.xml.extensions
98+
The `iidm.import.xml.extensions` property is an optional property that defines the list of extensions that we want to import by the XIIDM importer.
99+
By default all extensions will be imported.
100+
71101
# Deprecated configuration properties for IIDM-XML importer
72102

73103
## throwExceptionIfExtensionNotFound

0 commit comments

Comments
 (0)