<jupyter_start><jupyter_text>pypowsybl Interface "PowSyBl (Power System Blocks) is an open source framework written in Java, dedicated to electrical grid modelling and simulation, licensed under the Mozilla Public License version 2.0. It is part of LF Energy, an open source foundation focused on the power systems sector, hosted within The Linux Foundation."``pypowsybl`` is the Python interface to PowSybl. For more information, please visit: ANDES provides a simple interface to `pypowsybl`. The main goal is to leverage `pypowsybl` for drawing single-line diagrams and area diagrams for systems loaded in ANDES.  Imports<jupyter_code>import andes
import pypowsybl as pp

from andes.interop.pypowsybl import to_pypowsybl
ss = andes.load(andes.get_case("ieee14/ieee14_linetrip.xlsx"))<jupyter_output><empty_output><jupyter_text>Conversion Convert to a pypowsybl network:<jupyter_code>n = to_pypowsybl(ss)<jupyter_output><empty_output><jupyter_text>Run power flow in pypowsybl:<jupyter_code>results = pp.loadflow.run_ac(n)<jupyter_output><empty_output><jupyter_text>Diagrams `pypowsybl` provides two functions to draw diagrams:- `get_network_area_diagram(VOLTAGE_LEVEL_ID = None, DEPTH = 0)`- `get_single_line_diagram(CONTAINER_ID)`These function names are self explanatory. To draw the diagram for the whole network, do<jupyter_code>n.get_network_area_diagram()<jupyter_output><empty_output><jupyter_text>To draw the SLD for bus 6, do<jupyter_code>n.get_single_line_diagram("VL6")<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07738095238095238, 'fraction_numerical': 0.005952380952380952, 'mean_word_length': 7.9, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '596290', 'license': 'Apache-2.0', 'n_tokens_mistral': 524, 'n_tokens_neox': 504, 'n_words': 143, 'path': 'docs/source/examples/pypowsybl.ipynb', 'repo_name': 'cuihantao/Andes', 'size': '1512'}