Skip to content

Commit

Permalink
Cleaning files
Browse files Browse the repository at this point in the history
Signed-off-by: rtschupp <[email protected]>
  • Loading branch information
tschuppr committed Oct 18, 2023
1 parent 91a5c89 commit b55aa9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 38 deletions.
2 changes: 0 additions & 2 deletions src/tests/base_backend_test_powsybl.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
from abc import ABC, abstractmethod
import inspect

from grid2op.Action import CompleteAction

try:
# this is only available starting python 3.7 or 3.8... tests are with python 3.6 :-(
from math import comb
Expand Down
44 changes: 8 additions & 36 deletions src/tests/test_powsybl_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,21 @@
# Grid2op framework. Most parts of code have been paste/copy.

import unittest

import os
from pathlib import Path
from src.Backend.powsybl_backend import PowsyblBackend

from grid2op.tests.helper_path_test import PATH_DATA_TEST_PP, PATH_DATA_TEST
from grid2op.tests.helper_path_test import HelperTests
from src.tests.base_backend_test_powsybl import BaseTestNames
from src.tests.base_backend_test_powsybl import BaseTestLoadingCase
from src.tests.base_backend_test_powsybl import BaseTestLoadingBackendFunc
from src.tests.base_backend_test_powsybl import BaseTestTopoAction

from grid2op.tests.BaseBackendTest import BaseTestEnvPerformsCorrectCascadingFailures
from grid2op.tests.BaseBackendTest import BaseTestChangeBusAffectRightBus
from grid2op.tests.BaseBackendTest import BaseTestShuntAction
from grid2op.tests.BaseBackendTest import BaseTestResetEqualsLoadGrid
from grid2op.tests.BaseBackendTest import BaseTestVoltageOWhenDisco
from grid2op.tests.BaseBackendTest import BaseTestChangeBusSlack
from grid2op.tests.BaseBackendTest import BaseIssuesTest
from grid2op.tests.BaseBackendTest import BaseStatusActions
from grid2op.tests.BaseBackendTest import BaseTestStorageAction
import warnings
warnings.simplefilter("error")

test_dir = Path(__file__).parent.absolute()
implementation_dir = os.fspath(test_dir.parent.absolute())
data_dir = os.path.abspath(os.path.join(implementation_dir, "data_test"))
PATH_DATA_TEST_PYPOW = data_dir

PATH_DATA_TEST_INIT = PATH_DATA_TEST
#PATH_DATA_TEST = PATH_DATA_TEST_PP

import warnings

warnings.simplefilter("error")


class TestLoadingCase(HelperTests, BaseTestLoadingCase):
def make_backend(self, detailed_infos_for_cascading_failures=False):
Expand All @@ -50,19 +31,10 @@ def make_backend(self, detailed_infos_for_cascading_failures=False):
)

def get_path(self):
return PATH_DATA_TEST_PYPOW #PATH_DATA_TEST_PP #PATH_DATA_TEST #PATH_DATA_TEST_PYPOW
return PATH_DATA_TEST_PYPOW

def get_casefile(self):
return "grid.json"#"test_case14.json" #"test_case14.xiidm" #"case14_realistic_test.mat"

# class TestNames(HelperTests, BaseTestNames):
# def make_backend(self, detailed_infos_for_cascading_failures=False):
# return PowsyblBackend(
# detailed_infos_for_cascading_failures=detailed_infos_for_cascading_failures
# )

# def get_path(self):
# return PATH_DATA_TEST
return "grid.json"


class TestLoadingBackendFunc(HelperTests, BaseTestLoadingBackendFunc):
Expand All @@ -80,10 +52,10 @@ def make_backend(self, detailed_infos_for_cascading_failures=False):
)

def get_path(self):
return PATH_DATA_TEST_PYPOW #PATH_DATA_TEST_PP #PATH_DATA_TEST #PATH_DATA_TEST_PYPOW
return PATH_DATA_TEST_PYPOW

def get_casefile(self):
return "grid.json"#"test_case14.json" #"test_case14.xiidm"
return "grid.json"


class TestTopoAction(HelperTests, BaseTestTopoAction):
Expand All @@ -100,10 +72,10 @@ def make_backend(self, detailed_infos_for_cascading_failures=False):
)

def get_path(self):
return PATH_DATA_TEST_PYPOW #PATH_DATA_TEST_PP #PATH_DATA_TEST #PATH_DATA_TEST_PYPOW
return PATH_DATA_TEST_PYPOW

def get_casefile(self):
return "grid.json"#"test_case14.json" #"test_case14.xiidm"
return "grid.json"

if __name__ == "__main__":
unittest.main()
Expand Down

0 comments on commit b55aa9f

Please sign in to comment.