Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffroy Jamgotchian <[email protected]>
  • Loading branch information
geofjamg committed Nov 12, 2023
1 parent 0b1a1df commit e0f300f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions docs/user_guide/network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ Networks can be written to the filesystem, using one of the available export for

.. code-block:: python
network.dump('network.xiidm', format='XIIDM')
network.save('network.xiidm', format='XIIDM')
You can also serialize networks to a string:

.. code-block:: python
xiidm_str = network.dump_to_string('XIIDM')
xiidm_str = network.save_to_string('XIIDM')
And also to a zip file as a (io.BytesIO) binary buffer.

.. code-block:: python
zipped_xiidm = network.save_to_binary_buffer('XIIDM')
The supported formats are:

Expand Down
4 changes: 2 additions & 2 deletions pypowsybl/_pypowsybl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,8 @@ def get_extensions_names() -> List[str]: ...
def get_extensions_information() -> SeriesArray: ...
def create_security_analysis() -> JavaHandle: ...
def create_sensitivity_analysis() -> JavaHandle: ...
def dump_network(network: JavaHandle, file: str, format: str, parameters: Dict[str,str], report: Optional[JavaHandle]) -> None: ...
def dump_network_to_string(network: JavaHandle, format: str, parameters: Dict[str,str], report: Optional[JavaHandle]) -> str: ...
def save_network(network: JavaHandle, file: str, format: str, parameters: Dict[str,str], report: Optional[JavaHandle]) -> None: ...
def save_network_to_string(network: JavaHandle, format: str, parameters: Dict[str,str], report: Optional[JavaHandle]) -> str: ...
def get_branch_flows_sensitivity_matrix(sensitivity_analysis_result_context: JavaHandle, matrix_id: str, contingency_id: str) -> Matrix: ...
def get_branch_results(result: JavaHandle) -> SeriesArray: ...
def get_bus_breaker_view_buses(network: JavaHandle, voltage_level: str) -> SeriesArray: ...
Expand Down
2 changes: 1 addition & 1 deletion tests/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_save_matpower():
assert 'test.mat' in file_names
n2 = pp.network.load(mat_file)
assert isinstance(n2, pp.network.Network)
# assert n2.dump_to_string() == n.dump_to_string() # problem import/export matpower
# assert n2.save_to_string() == n.save_to_string() # problem import/export matpower


def test_save_ucte():
Expand Down

0 comments on commit e0f300f

Please sign in to comment.