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

Feature/Adding GUID info to the extra_info field #249

Merged
merged 4 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 6 additions & 1 deletion docs/converters/vision_converter.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,9 @@ Some components are yet to be modeled for conversions because they might not hav
- The conversions for load behaviors of `industry`, `residential` and `business` are not yet modeled. The load behaviors usually do not create a significant difference in power-flow results for most grids when the voltage at bus is close to `1 pu`. Hence, the conversion of the mentioned load behaviors is approximated to be of `Constant Power` type for the time being.
- The source bus in power-grid-model is mapped with a source impedance. `Sk"nom`, `R/X` and `Z0/Z1` are the attributes used in modeling source impedance. In Vision, these attributes are used only for short circuit calculations
- The load rate for transformer is calculated in Vision by current i.e., `load_rate = max(u1 * I1, u2 * I2) * sqrt(3) / Snom * 100`. Whereas in power-grid-model, loading is calculated by power, i.e., `loading = max(s1,s2)/sn`. (Note: The attribute names are as per relevant notation in Vision and PGM respectively). This gives a slight difference in load rate of transformer.
- A minor difference in results is expected since Vision uses a power mismatch in p.u. as convergence criteria whereas power-grid-model uses voltage mismatch.
- A minor difference in results is expected since Vision uses a power mismatch in p.u. as convergence criteria whereas power-grid-model uses voltage mismatch.

## Accomdation of UUID-based id system since Vision 9.7
Vision introduced UUID based identifier system since version 9.7. It is implemented following the Microsoft naming scheme by replacing all the original identifier fields (i.e., '*Number', '*Subnumber', '*Nummber' and '*Subnummer') to GUID. This change brings the many benefits of UUID's in general while on the other hand adds certain work on the conversion side. Since computations in PGM alone do not benefit from a string based identifier, we hence made the descision to perform UUID to integer conversion while maintaining the 'GUID' information in the `extra_info` field. Note that existing mapping files can still be used without significant changes, apart from adding `GUID` to the `extra` fields of interest.

An examplery usage can be found in the example notebook as well as in the test cases.
54 changes: 54 additions & 0 deletions docs/examples/vision_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,60 @@
" display(Markdown(f\"<pre style='max-height: 160px; overflow: scroll; white-space: pre'>{json_file.read()}</pre>\"))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### GUID since Vision 9.7\n",
Jerry-Jinfeng-Guo marked this conversation as resolved.
Show resolved Hide resolved
"To accomdate GUID's since version 9.7, we have internal conversion mechanism that converts GUID's to unique integers (persession). This change does not impact anything on the user side. Therefore, loading such new excel files is performed exactly as in previous versions. Here, we only show how one could add corresponding GUID information to the extra_info. \n"
Jerry-Jinfeng-Guo marked this conversation as resolved.
Show resolved Hide resolved
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In the custom mapping file, add `GUID` to the `extra` field of interest:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# custom yaml mapping file\n",
"...\n",
"grid:\n",
" Nodes:\n",
" node:\n",
" id:\n",
" auto_id:\n",
" key: Number\n",
" u_rated: Unom\n",
" extra:\n",
" - ID\n",
" - Name\n",
" - GUID\n",
" Cables:\n",
" line:\n",
" id:\n",
" auto_id:\n",
" key: Number\n",
" from_node:\n",
" auto_id:\n",
" table: Nodes\n",
" key:\n",
" Number: From.Number\n",
"..."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"When run excel conversion with mapping file that contains this change, `GUID` information will be part of the returned `extra_info`."
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
Loading
Loading