Skip to content

Commit

Permalink
attempt to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BDonnot committed Jul 25, 2024
1 parent 1accc80 commit 5d8d97f
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 26 deletions.
12 changes: 9 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ jobs:
resource_class: small
steps:
- checkout
- run: apt-get update && apt-get install python3.10-full python3.10-dev python3.10-pip python3.10-virtualenv git -y
- run: python3.12 -m virtualenv venv_test
- run: apt-get update && apt-get install --reinstall ca-certificates -y
- run: add-apt-repository 'ppa:deadsnakes/ppa' -y
- run: apt-get update && install python3.10-full python3.10-dev python3.10-pip python3.10-virtualenv git -y
- run: python3.10 -m virtualenv venv_test
- run:
name: Get python version
command:
python3.12 --version
python3.10 --version
- run:
name: "Set up virtual environment"
command: |
Expand Down Expand Up @@ -205,6 +207,8 @@ jobs:
resource_class: medium
steps:
- checkout
- run: apt-get update && apt-get install --reinstall ca-certificates -y
- run: add-apt-repository 'ppa:deadsnakes/ppa' -y
- run: apt-get update && apt-get install python3.12-full python3.12-dev python3.12-pip python3.12-virtualenv git -y
- run:
name: Get python version
Expand Down Expand Up @@ -413,6 +417,8 @@ jobs:
resource_class: medium
steps:
- checkout
- run: apt-get update && apt-get install --reinstall ca-certificates -y
- run: add-apt-repository 'ppa:deadsnakes/ppa' -y
- run: apt-get update && apt-get install python3.12-full python3.12-dev python3.12-pip python3.12-virtualenv git -y
- run:
name: Get python version
Expand Down
40 changes: 26 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
python3 -c "from lightsim2grid.timeSerie import TimeSeriesCPP"
python3 -c "from lightsim2grid.contingencyAnalysis import ContingencyAnalysisCPP"
python3 -c "from lightsim2grid.securityAnalysis import SecurityAnalysisCPP"
python3 -c "from lightsim2grid.gridmodel import init, GridModel"
python3 -c "from lightsim2grid.gridmodel import GridModel"
- name: Fix urllib3 (python 3.7)
if: matrix.python.name == 'cp37'
Expand All @@ -134,6 +134,7 @@ jobs:
python3 -c "from lightsim2grid.contingencyAnalysis import ContingencyAnalysis"
python3 -c "from lightsim2grid.physical_law_checker import PhysicalLawChecker"
python3 -c "from lightsim2grid.securityAnalysis import SecurityAnalysis"
python3 -c "from lightsim2grid.gridmodel import init_from_pandapower"

- name: Check LightSimBackend can be used to create env
run:
Expand Down Expand Up @@ -242,22 +243,30 @@ jobs:
shell: bash
run: python -m pip install dist/*.whl --user

- name: Check package can be imported
- name: Check package can be imported (bare install)
run: |
mkdir tmp_for_import_checking
cd tmp_for_import_checking
python -c "import lightsim2grid"
python -c "from lightsim2grid import *"
python -c "from lightsim2grid.newtonpf import newtonpf"
cd ..
python3 -c "import lightsim2grid"
python3 -c "from lightsim2grid import *"
python3 -c "from lightsim2grid.newtonpf import newtonpf"
python3 -c "from lightsim2grid.timeSerie import TimeSeriesCPP"
python3 -c "from lightsim2grid.contingencyAnalysis import ContingencyAnalysisCPP"
python3 -c "from lightsim2grid.securityAnalysis import SecurityAnalysisCPP"
python3 -c "from lightsim2grid.gridmodel import GridModel"
- name: Check LightSimBackend can be imported
- name: Check LightSimBackend can be imported (with grid2op)
run: |
cd tmp_for_import_checking
python -m pip install grid2op
cd tmp_for_import_checking
python -c "from lightsim2grid import LightSimBackend"
python -c "from lightsim2grid import LightSimBackend; import grid2op; env = grid2op.make('l2rpn_case14_sandbox', test=True, backend=LightSimBackend())"
python -c "from lightsim2grid.timeSerie import TimeSerie"
python -c "from lightsim2grid.contingencyAnalysis import ContingencyAnalysis"
python -c "from lightsim2grid.physical_law_checker import PhysicalLawChecker"
python -c "from lightsim2grid.securityAnalysis import SecurityAnalysis"
python -c "from lightsim2grid.gridmodel import init_from_pandapower"
# - name: Debug windows CI
# run: |
# python -m unittest lightsim2grid.tests.test_n1contingencyrewards.TestN1ContingencyReward_Base.test_do_nothing
Expand Down Expand Up @@ -374,7 +383,7 @@ jobs:
python -c "from lightsim2grid.timeSerie import TimeSeriesCPP"
python -c "from lightsim2grid.contingencyAnalysis import ContingencyAnalysisCPP"
python -c "from lightsim2grid.securityAnalysis import SecurityAnalysisCPP"
python -c "from lightsim2grid.gridmodel import init, GridModel"
python -c "from lightsim2grid.gridmodel import GridModel"
- name: Fix urllib3 (python 3.7)
if: matrix.python.name == 'cp37'
Expand All @@ -395,6 +404,7 @@ jobs:
python -c "from lightsim2grid.contingencyAnalysis import ContingencyAnalysis"
python -c "from lightsim2grid.physical_law_checker import PhysicalLawChecker"
python -c "from lightsim2grid.securityAnalysis import SecurityAnalysis"
python -c "from lightsim2grid.gridmodel import init_from_pandapower"
- name: Check LightSimBackend can be used to create env
run: |
Expand Down Expand Up @@ -510,10 +520,12 @@ jobs:
python -c "import lightsim2grid" &&
python -c "from lightsim2grid import *" &&
python -c "from lightsim2grid.newtonpf import newtonpf" &&
python -c "from lightsim2grid.timeSerie import TimeSeriesCPP" &&
python -c "from lightsim2grid.contingencyAnalysis import ContingencyAnalysisCPP" &&
python -c "from lightsim2grid.securityAnalysis import SecurityAnalysisCPP" &&
python -c "from lightsim2grid.gridmodel import init, GridModel"
python -c "from lightsim2grid.timeSerie import TimeSeriesCPP, TimeSerie" &&
python -c "from lightsim2grid.contingencyAnalysis import ContingencyAnalysisCPP, ContingencyAnalysis" &&
python -c "from lightsim2grid.securityAnalysis import SecurityAnalysisCPP, SecurityAnalysis" &&
python -c "from lightsim2grid.gridmodel import GridModel, init_from_pandapower" &&
python -c "from lightsim2grid import LightSimBackend" &&
python -c "from lightsim2grid.physical_law_checker import PhysicalLawChecker"
- name: Upload wheel
uses: actions/upload-artifact@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
import pypowsybl.network as pypo_n
import grid2op

from lightsim2grid.gridmodel import init_from_pandapower
from lightsim2grid.gridmodel import init_from_pypowsybl

from lightsim2grid.gridmodel import init_from_pandapower, init_from_pypowsybl


def get_voltage_level_id(el, nb_dig_bus):
Expand Down
4 changes: 1 addition & 3 deletions lightsim2grid/tests/test_Deactivatedbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
# SPDX-License-Identifier: MPL-2.0
# This file is part of LightSim2grid, LightSim2grid implements a c++ backend targeting the Grid2Op platform.

import os
import unittest
import copy
import numpy as np
from scipy import sparse
from lightsim2grid.gridmodel import init
from lightsim2grid.gridmodel import init_from_pandapower
import pandapower.networks as pn
import pandapower as pp
import warnings
Expand Down
1 change: 0 additions & 1 deletion lightsim2grid/tests/test_fdpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import warnings
import numpy as np
from scipy.sparse import csc_matrix

from lightsim2grid_cpp import FDPFMethod
from lightsim2grid.gridmodel import init_from_pandapower
Expand Down
2 changes: 0 additions & 2 deletions lightsim2grid/tests/test_nr_case300.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

import warnings
import numpy as np
from scipy.sparse import csc_matrix

from lightsim2grid.gridmodel import init_from_pandapower
from lightsim2grid.solver import SolverType

import pandapower.networks as pn
import pandapower as pp
Expand Down

0 comments on commit 5d8d97f

Please sign in to comment.