Skip to content

Commit

Permalink
hotfix for grid initialized from pypowsybl
Browse files Browse the repository at this point in the history
Signed-off-by: DONNOT Benjamin <[email protected]>
  • Loading branch information
BDonnot committed Nov 26, 2024
1 parent d22a076 commit 53acb35
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ 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.post1] 2024-11-28
--------------------------
- [FIXED] There is still a bug with the pypowsybl 1.8.1 version with the
tap changer ratio (unconsistency between what needs to be done and the
actual documentation). The fix is to set the const variable `PP_BUG_RATIO_TAP_CHANGER`
to be at least 1.9.0, otherwise results are wrong.

[0.9.2] 2024-10-18
--------------------------
- [ADDED] support loading a grid when everything is NOT on the same bus
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/benchmark_grid_size.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"case9241pegase.json"
]

def make_grid2op_env(pp_case, casse_name, load_p, load_q, gen_p, sgen_p):
def make_grid2op_env(pp_case, case_name, load_p, load_q, gen_p, sgen_p):
param = Parameters.Parameters()
param.init_from_dict({"NO_OVERFLOW_DISCONNECTION": True})

Expand All @@ -75,7 +75,7 @@ def make_grid2op_env(pp_case, casse_name, load_p, load_q, gen_p, sgen_p):
return env_lightsim


def make_grid2op_env_pp(pp_case, casse_name, load_p, load_q, gen_p, sgen_p):
def make_grid2op_env_pp(pp_case, case_name, load_p, load_q, gen_p, sgen_p):
param = Parameters.Parameters()
param.init_from_dict({"NO_OVERFLOW_DISCONNECTION": True})

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Benjamin DONNOT'

# The full version, including alpha/beta/rc tags
release = "0.9.2"
release = "0.9.2.post1"
version = '0.9'

# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion lightsim2grid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
__version__ = "0.9.2.post1"

__all__ = ["newtonpf", "SolverType", "ErrorType", "solver", "compilation_options"]

Expand Down
2 changes: 1 addition & 1 deletion lightsim2grid/gridmodel/from_pypowsybl/_from_pypowsybl.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from typing import Optional, Union
from packaging import version

PP_BUG_RATIO_TAP_CHANGER = version.parse("1.7.0")
PP_BUG_RATIO_TAP_CHANGER = version.parse("1.9.0")
PYPOWSYBL_VER = version.parse(pypo.__version__)
from lightsim2grid_cpp import GridModel

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from pybind11.setup_helpers import Pybind11Extension, build_ext


__version__ = "0.9.2"
__version__ = "0.9.2.post1"
KLU_SOLVER_AVAILABLE = False

# Try to link against SuiteSparse (if available)
Expand Down
8 changes: 4 additions & 4 deletions src/powerflow_algorithm/BaseAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ void BaseAlgo::reset(){


RealVect BaseAlgo::_evaluate_Fx(const Eigen::SparseMatrix<cplx_type> & Ybus,
const CplxVect & V,
const CplxVect & Sbus,
const Eigen::VectorXi & pv,
const Eigen::VectorXi & pq)
const CplxVect & V,
const CplxVect & Sbus,
const Eigen::VectorXi & pv,
const Eigen::VectorXi & pq)
{
auto timer = CustTimer();
auto npv = pv.size();
Expand Down

0 comments on commit 53acb35

Please sign in to comment.