diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7ddf4ad..5beaee2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -26,6 +26,11 @@ TODO: in `main.cpp` check the returned policy of pybind11 and also the `py::call TODO: a cpp class that is able to compute (DC powerflow) ContingencyAnalysis and TimeSeries using PTDF and LODF TODO: integration test with pandapower (see `pandapower/contingency/contingency.py` and import `lightsim2grid_installed` and check it's True) +[0.9.2.post2] 2024-11-28 +-------------------------- +- [FIXED] The attribute `can_output_theta` (of base `Backend` class) + was not set to `True` if using the pypowsybl loader. + [0.9.2.post1] 2024-11-28 -------------------------- - [FIXED] There is still a bug with the pypowsybl 1.8.1 version with the diff --git a/docs/conf.py b/docs/conf.py index 6002417..93f2a29 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ author = 'Benjamin DONNOT' # The full version, including alpha/beta/rc tags -release = "0.9.2.post1" +release = "0.9.2.post2" version = '0.9' # -- General configuration --------------------------------------------------- diff --git a/lightsim2grid/__init__.py b/lightsim2grid/__init__.py index 7b02000..d1c3abe 100644 --- a/lightsim2grid/__init__.py +++ b/lightsim2grid/__init__.py @@ -6,7 +6,7 @@ # SPDX-License-Identifier: MPL-2.0 # This file is part of LightSim2grid, LightSim2grid implements a c++ backend targeting the Grid2Op platform. -__version__ = "0.9.2.post1" +__version__ = "0.9.2.post2" __all__ = ["newtonpf", "SolverType", "ErrorType", "solver", "compilation_options"] diff --git a/lightsim2grid/lightSimBackend.py b/lightsim2grid/lightSimBackend.py index 9bde6e9..8fe4ce3 100644 --- a/lightsim2grid/lightSimBackend.py +++ b/lightsim2grid/lightSimBackend.py @@ -156,6 +156,9 @@ def __init__(self, if not hasattr(self, "_can_be_copied"): self._can_be_copied = can_be_copied + #: I can output the voltage angle + self.can_output_theta = True + #: .. versionadded:: 0.8.0 #: #: Which type of grid format can be read by your backend. @@ -836,7 +839,6 @@ def _load_grid_pandapower(self, path=None, filename=None): self._aux_init_pandapower() def _aux_init_pandapower(self): - self.can_output_theta = True # i can compute the "theta" and output it to grid2op from lightsim2grid.gridmodel import init_from_pandapower self._grid = init_from_pandapower(self.init_pp_backend._grid) self.__nb_bus_before = self.init_pp_backend.get_nb_active_bus() diff --git a/lightsim2grid/tests/test_backend_pypowsybl.py b/lightsim2grid/tests/test_backend_pypowsybl.py index e52033f..9490def 100644 --- a/lightsim2grid/tests/test_backend_pypowsybl.py +++ b/lightsim2grid/tests/test_backend_pypowsybl.py @@ -71,6 +71,7 @@ def test_runpf(self): # DC powerflow conv, exc_ = backend.runpf(is_dc=True) assert conv + assert backend.can_output_theta class BackendTester2(unittest.TestCase): """issue is still not replicated and these tests pass""" @@ -101,6 +102,7 @@ def test_runpf(self): # DC powerflow conv, exc_ = backend.runpf(is_dc=True) assert conv + assert backend.can_output_theta if CAN_DO_TEST_SUITE: dir_path = os.path.dirname(os.path.realpath(__file__)) diff --git a/setup.py b/setup.py index 066687f..8667f7c 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from pybind11.setup_helpers import Pybind11Extension, build_ext -__version__ = "0.9.2.post1" +__version__ = "0.9.2.post2" KLU_SOLVER_AVAILABLE = False # Try to link against SuiteSparse (if available)