Skip to content

Commit

Permalink
Merge pull request #2240 from rbolgaryn/fix/ls2g_imports
Browse files Browse the repository at this point in the history
fix lightsim2grid 0.8.0 imports
  • Loading branch information
SteffenMeinecke authored Mar 25, 2024
2 parents 5e85ca8 + 7353db1 commit f498c44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/github_test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
if ${{ matrix.python-version == '3.9' }}; then python -m pip install pypower; fi
if ${{ matrix.python-version != '3.9' }}; then python -m pip install numba; fi
if ${{ matrix.python-version == '3.8' || matrix.python-version == '3.10' }}; then python -m pip install lightsim2grid; fi
if ${{ matrix.python-version == '3.8' || matrix.python-version == '3.10' }}; then python -m pip install grid2op; fi
- name: Install Julia
if: ${{ matrix.python-version == '3.9' }}
run: |
Expand Down Expand Up @@ -187,6 +188,7 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .["all"]
python -m pip install lightsim2grid
python -m pip install grid2op
- name: List all installed packages
run: |
pip list
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Change Log
- [ADDED] cim2pp: added description fields for each asset and added BusbarSection information to nodes
- [CHANGED] cim2pp: reformat documentation for reading in files
- [CHANGED] allow providing grid_tables as a parameter to the function that downloads net from PostgreSQL
- [FIXED] compatibility with lightsim2grid after new version 0.8.0

[2.13.1] - 2023-05-12
-------------------------------
Expand Down
5 changes: 3 additions & 2 deletions pandapower/contingency/contingency.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

try:
from lightsim2grid.gridmodel import init as init_ls2g
from lightsim2grid_cpp import SecurityAnalysisCPP, SolverType
from lightsim2grid.securityAnalysis import ContingencyAnalysisCPP
from lightsim2grid_cpp import SolverType

lightsim2grid_installed = True
except ImportError:
Expand Down Expand Up @@ -198,7 +199,7 @@ def run_contingency_ls2g(net, nminus1_cases, contingency_evaluation_function=pp.
n_trafos_cases = len(nminus1_cases.get("trafo", {}).get("index", []))

# todo: add option for DC power flow
s = SecurityAnalysisCPP(lightsim_grid_model)
s = ContingencyAnalysisCPP(lightsim_grid_model)
s.change_solver(solver_type)

map_index = {}
Expand Down

0 comments on commit f498c44

Please sign in to comment.