Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/validating-pws-with-bcs' into va…
Browse files Browse the repository at this point in the history
…lidating-pws-with-bcs
lmdiazangulo committed Dec 25, 2024

Verified

This commit was signed with the committer’s verified signature.
DanielSchiavini Daniel Schiavini
2 parents f9abb09 + 11d99c0 commit 8e43948
Showing 9 changed files with 28 additions and 42 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/ubuntu-nvidia.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ jobs:
build-type: ["Debug", "Release"]
mpi: ["No"]
mtln: ["No"]
hdf: ["Yes"]
hdf: ["No"]

name: ${{matrix.build-type}}- mpi ${{matrix.mpi}} - mtln ${{matrix.mtln}} - hdf ${{matrix.hdf}}

@@ -59,12 +59,8 @@ jobs:
run: |
python -m pip install -r requirements.txt
- name: Run all wrapper tests
if: matrix.mtln=='Yes'
run: python -m pytest test/

- name: Run non-mtln wrapper tests
if: matrix.mtln=='No'
run: python -m pytest -m 'not mtln' test/
- name: Run non-mtln and non-hdf wrapper tests
if: matrix.mtln=='No' || matrix.hdf=='No'
run: python -m pytest -m 'not mtln and not hdf5' test/


8 changes: 7 additions & 1 deletion .github/workflows/windows-intelLLVM.yml
Original file line number Diff line number Diff line change
@@ -19,9 +19,15 @@ jobs:
matrix:
build-type: ["Debug", "Release"]
mpi: ["No"]
mtln: ["Yes", "No"]
mtln: ["Yes"]
hdf: ["Yes"]

include:
- build-type: "Release"
mpi: "No"
mtln: "No"
hdf: "Yes"

name: windows-intelLLVM ${{matrix.build-type}} - mpi ${{matrix.mpi}} - mtln ${{matrix.mtln}}

steps:
3 changes: 2 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[pytest]
markers =
mtln: tests which use mtln features.
codemodel: test that need xspice codemodels.
codemodel: test that need xspice codemodels.
hdf5: tests that need hdf5.
4 changes: 2 additions & 2 deletions src_pyWrapper/pyWrapper.py
Original file line number Diff line number Diff line change
@@ -94,8 +94,8 @@ class FDTD():
def __init__(self, input_filename, path_to_exe=None, flags = [], run_in_folder = None):
self._setFilename(input_filename)

if path_to_exe == None:
self.path_to_exe = os.getcwd() + DEFAULT_SEMBA_FDTD_PATH
if path_to_exe is None:
self.path_to_exe = os.path.join(os.getcwd(), DEFAULT_SEMBA_FDTD_PATH)
else:
self.path_to_exe = path_to_exe
assert os.path.isfile(self.path_to_exe)
11 changes: 1 addition & 10 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -26,13 +26,4 @@ target_link_libraries(fdtd_tests
${SMBJSON_TESTS_LIBRARY}
${SYSTEM_TESTS_LIBRARY}
GTest::gtest_main
)


if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND SEMBA_FDTD_ENABLE_MTLN)
add_custom_command(TARGET fdtd_tests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${NGSPICE_DIR}ngspice.dll"
$<TARGET_FILE_DIR:fdtd_tests>
)
endif()
)
1 change: 1 addition & 0 deletions test/pyWrapper/test_full_system.py
Original file line number Diff line number Diff line change
@@ -104,6 +104,7 @@ def test_towelHanger(tmp_path):
assert np.allclose(p_expected[i].df.to_numpy()[:,0:3], p_solved.df.to_numpy()[:,0:3], rtol = 5e-2, atol=5e-2)


@pytest.mark.hdf5
def test_sphere(tmp_path):
fn = CASE_FOLDER + 'sphere/sphere.fdtd.json'
solver = FDTD(input_filename = fn, path_to_exe=SEMBA_EXE, run_in_folder=tmp_path)
2 changes: 1 addition & 1 deletion test/pyWrapper/test_pyWrapper.py
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ def test_read_point_probe():


def test_set_new_folder_to_run(tmp_path):
input = CASE_FOLDER + 'planewave/pw-in-box.fdtd.json'
input = os.path.join(CASE_FOLDER, 'planewave', 'pw-in-box.fdtd.json')
solver = FDTD(input, path_to_exe=SEMBA_EXE, run_in_folder=tmp_path)

solver.input['general']['numberOfSteps'] = 1
20 changes: 10 additions & 10 deletions test/pyWrapper/utils.py
Original file line number Diff line number Diff line change
@@ -8,17 +8,17 @@
from sys import platform

# Use of absolute path to avoid conflicts when changing directory.
EXE_FOLDER = os.getcwd() + '/build/bin/'
SEMBA_EXE = os.getcwd() + '/build/bin/semba-fdtd'
SEMBA_EXE_INTEL_LLVM_RELEASE = os.getcwd() + '/build-ubuntu-intelLLVM-release/bin/semba-fdtd'
SEMBA_EXE_INTEL_LLVM_DEBUG = os.getcwd() + '/build-ubuntu-intelLLVM-debug/bin/semba-fdtd'
TEST_DATA_FOLDER = os.getcwd() + '/testData/'
if platform == "linux":
SEMBA_EXE = os.path.join(os.getcwd(), 'build', 'bin', 'semba-fdtd')
elif platform == "win32":
SEMBA_EXE = os.path.join(os.getcwd(), 'build', 'bin', 'semba-fdtd.exe')

CASE_FOLDER = TEST_DATA_FOLDER + 'cases/'
MODELS_FOLDER = TEST_DATA_FOLDER + 'models/'
EXCITATIONS_FOLDER = TEST_DATA_FOLDER + 'excitations/'
OUTPUT_FOLDER = TEST_DATA_FOLDER + 'outputs/'
SPINIT_FOLDER = TEST_DATA_FOLDER + 'spinit/'
TEST_DATA_FOLDER = os.path.join(os.getcwd(), 'testData/')
CASE_FOLDER = os.path.join(TEST_DATA_FOLDER, 'cases/')
MODELS_FOLDER = os.path.join(TEST_DATA_FOLDER, 'models/')
EXCITATIONS_FOLDER = os.path.join(TEST_DATA_FOLDER, 'excitations/')
OUTPUT_FOLDER = os.path.join(TEST_DATA_FOLDER, 'outputs/')
SPINIT_FOLDER = os.path.join(TEST_DATA_FOLDER, 'spinit/')

def getCase(case):
return json.load(open(CASE_FOLDER + case + '.fdtd.json'))
9 changes: 0 additions & 9 deletions test/system/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -20,15 +20,6 @@ target_link_libraries(system_test_fortran

add_library(system_tests "system_tests.cpp")

if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND SEMBA_FDTD_ENABLE_MTLN)
add_custom_command(TARGET system_tests POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${NGSPICE_DIR}ngspice.dll"
$<TARGET_FILE_DIR:system_tests>
)
endif()


target_link_libraries(system_tests
system_test_fortran
GTest::gtest

0 comments on commit 8e43948

Please sign in to comment.