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 export in the cgmes notebook #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
288 changes: 285 additions & 3 deletions cgmes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@
"</svg>\n"
],
"text/plain": [
"<pypowsybl.network.impl.svg.Svg at 0x7f97fd1c1e50>"
"<pypowsybl.network.impl.svg.Svg at 0x7fbedb8f9490>"
]
},
"execution_count": 4,
Expand Down Expand Up @@ -1075,7 +1075,7 @@
"</svg>\n"
],
"text/plain": [
"<pypowsybl.network.impl.svg.Svg at 0x7f97fd1d1520>"
"<pypowsybl.network.impl.svg.Svg at 0x7fbedb906280>"
]
},
"execution_count": 5,
Expand Down Expand Up @@ -2311,7 +2311,7 @@
"</svg>\n"
],
"text/plain": [
"<pypowsybl.network.impl.svg.Svg at 0x7f97fc094e50>"
"<pypowsybl.network.impl.svg.Svg at 0x7fbed9fb6310>"
]
},
"execution_count": 12,
Expand Down Expand Up @@ -3829,6 +3829,288 @@
"results = sa.run(eu)\n",
"results.get_branch_flows_sensitivity_matrix()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"CGMES full export"
]
},
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"eu.save(\"./eu\", \"CGMES\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Export only the SV"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"eu.save(\"/home/piloquetcol/test/eu_test\", \"CGMES\", parameters={'iidm.export.cgmes.profiles': 'SV'})"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For information, the export parameters for the CGMES format"
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>description</th>\n",
" <th>type</th>\n",
" <th>default</th>\n",
" <th>possible_values</th>\n",
" </tr>\n",
" <tr>\n",
" <th>name</th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>iidm.export.cgmes.base-name</th>\n",
" <td>Basename for output files</td>\n",
" <td>STRING</td>\n",
" <td></td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.cim-version</th>\n",
" <td>CIM version to export</td>\n",
" <td>STRING</td>\n",
" <td></td>\n",
" <td>[14, 16, 100]</td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.export-boundary-power-flows</th>\n",
" <td>Export boundaries' power flows</td>\n",
" <td>BOOLEAN</td>\n",
" <td>true</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.export-power-flows-for-switches</th>\n",
" <td>Export power flows for switches</td>\n",
" <td>BOOLEAN</td>\n",
" <td>true</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.naming-strategy</th>\n",
" <td>Configure what type of naming strategy you want</td>\n",
" <td>STRING</td>\n",
" <td>identity</td>\n",
" <td>[identity, cgmes, cgmes-fix-all-invalid-ids]</td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.profiles</th>\n",
" <td>Profiles to export</td>\n",
" <td>STRING_LIST</td>\n",
" <td>[EQ, TP, SSH, SV]</td>\n",
" <td>[EQ, TP, SSH, SV]</td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.boundary-EQ-identifier</th>\n",
" <td>Boundary EQ model identifier</td>\n",
" <td>STRING</td>\n",
" <td></td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.boundary-TP-identifier</th>\n",
" <td>Boundary TP model identifier</td>\n",
" <td>STRING</td>\n",
" <td></td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.modeling-authority-set</th>\n",
" <td>Modeling authority set</td>\n",
" <td>STRING</td>\n",
" <td>powsybl.org</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.model-description</th>\n",
" <td>Model description</td>\n",
" <td>STRING</td>\n",
" <td></td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.export-transformers-with-highest-voltage-at-end1</th>\n",
" <td>Export transformers with highest voltage at end1</td>\n",
" <td>BOOLEAN</td>\n",
" <td>false</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.sourcing-actor</th>\n",
" <td>Sourcing actor name (for CGM business processes)</td>\n",
" <td>STRING</td>\n",
" <td></td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.export-load-flow-status</th>\n",
" <td>Export load flow status of topological islands</td>\n",
" <td>BOOLEAN</td>\n",
" <td>true</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.max-p-mismatch-converged</th>\n",
" <td>Max mismatch in active power to consider a bus...</td>\n",
" <td>DOUBLE</td>\n",
" <td>0.1</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.max-q-mismatch-converged</th>\n",
" <td>Max mismatch in reactive power to consider a b...</td>\n",
" <td>DOUBLE</td>\n",
" <td>0.1</td>\n",
" <td></td>\n",
" </tr>\n",
" <tr>\n",
" <th>iidm.export.cgmes.export-sv-injections-for-slacks</th>\n",
" <td>Export SvInjections with the mismatch of slack...</td>\n",
" <td>BOOLEAN</td>\n",
" <td>true</td>\n",
" <td></td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" description \\\n",
"name \n",
"iidm.export.cgmes.base-name Basename for output files \n",
"iidm.export.cgmes.cim-version CIM version to export \n",
"iidm.export.cgmes.export-boundary-power-flows Export boundaries' power flows \n",
"iidm.export.cgmes.export-power-flows-for-switches Export power flows for switches \n",
"iidm.export.cgmes.naming-strategy Configure what type of naming strategy you want \n",
"iidm.export.cgmes.profiles Profiles to export \n",
"iidm.export.cgmes.boundary-EQ-identifier Boundary EQ model identifier \n",
"iidm.export.cgmes.boundary-TP-identifier Boundary TP model identifier \n",
"iidm.export.cgmes.modeling-authority-set Modeling authority set \n",
"iidm.export.cgmes.model-description Model description \n",
"iidm.export.cgmes.export-transformers-with-high... Export transformers with highest voltage at end1 \n",
"iidm.export.cgmes.sourcing-actor Sourcing actor name (for CGM business processes) \n",
"iidm.export.cgmes.export-load-flow-status Export load flow status of topological islands \n",
"iidm.export.cgmes.max-p-mismatch-converged Max mismatch in active power to consider a bus... \n",
"iidm.export.cgmes.max-q-mismatch-converged Max mismatch in reactive power to consider a b... \n",
"iidm.export.cgmes.export-sv-injections-for-slacks Export SvInjections with the mismatch of slack... \n",
"\n",
" type \\\n",
"name \n",
"iidm.export.cgmes.base-name STRING \n",
"iidm.export.cgmes.cim-version STRING \n",
"iidm.export.cgmes.export-boundary-power-flows BOOLEAN \n",
"iidm.export.cgmes.export-power-flows-for-switches BOOLEAN \n",
"iidm.export.cgmes.naming-strategy STRING \n",
"iidm.export.cgmes.profiles STRING_LIST \n",
"iidm.export.cgmes.boundary-EQ-identifier STRING \n",
"iidm.export.cgmes.boundary-TP-identifier STRING \n",
"iidm.export.cgmes.modeling-authority-set STRING \n",
"iidm.export.cgmes.model-description STRING \n",
"iidm.export.cgmes.export-transformers-with-high... BOOLEAN \n",
"iidm.export.cgmes.sourcing-actor STRING \n",
"iidm.export.cgmes.export-load-flow-status BOOLEAN \n",
"iidm.export.cgmes.max-p-mismatch-converged DOUBLE \n",
"iidm.export.cgmes.max-q-mismatch-converged DOUBLE \n",
"iidm.export.cgmes.export-sv-injections-for-slacks BOOLEAN \n",
"\n",
" default \\\n",
"name \n",
"iidm.export.cgmes.base-name \n",
"iidm.export.cgmes.cim-version \n",
"iidm.export.cgmes.export-boundary-power-flows true \n",
"iidm.export.cgmes.export-power-flows-for-switches true \n",
"iidm.export.cgmes.naming-strategy identity \n",
"iidm.export.cgmes.profiles [EQ, TP, SSH, SV] \n",
"iidm.export.cgmes.boundary-EQ-identifier \n",
"iidm.export.cgmes.boundary-TP-identifier \n",
"iidm.export.cgmes.modeling-authority-set powsybl.org \n",
"iidm.export.cgmes.model-description \n",
"iidm.export.cgmes.export-transformers-with-high... false \n",
"iidm.export.cgmes.sourcing-actor \n",
"iidm.export.cgmes.export-load-flow-status true \n",
"iidm.export.cgmes.max-p-mismatch-converged 0.1 \n",
"iidm.export.cgmes.max-q-mismatch-converged 0.1 \n",
"iidm.export.cgmes.export-sv-injections-for-slacks true \n",
"\n",
" possible_values \n",
"name \n",
"iidm.export.cgmes.base-name \n",
"iidm.export.cgmes.cim-version [14, 16, 100] \n",
"iidm.export.cgmes.export-boundary-power-flows \n",
"iidm.export.cgmes.export-power-flows-for-switches \n",
"iidm.export.cgmes.naming-strategy [identity, cgmes, cgmes-fix-all-invalid-ids] \n",
"iidm.export.cgmes.profiles [EQ, TP, SSH, SV] \n",
"iidm.export.cgmes.boundary-EQ-identifier \n",
"iidm.export.cgmes.boundary-TP-identifier \n",
"iidm.export.cgmes.modeling-authority-set \n",
"iidm.export.cgmes.model-description \n",
"iidm.export.cgmes.export-transformers-with-high... \n",
"iidm.export.cgmes.sourcing-actor \n",
"iidm.export.cgmes.export-load-flow-status \n",
"iidm.export.cgmes.max-p-mismatch-converged \n",
"iidm.export.cgmes.max-q-mismatch-converged \n",
"iidm.export.cgmes.export-sv-injections-for-slacks "
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pp.network.get_export_parameters(\"CGMES\")"
]
}
],
"metadata": {
Expand Down