Skip to content

Commit

Permalink
Fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
lmdiazangulo committed Dec 24, 2024
1 parent 209879e commit 2305970
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src_pyWrapper/pyWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion test/pyWrapper/test_pyWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions test/pyWrapper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down

0 comments on commit 2305970

Please sign in to comment.