486f3140cb
Currently, running openEMS's example Python scripts on macOS always fails with the following error: $ python3 MSL_NotchFilter.py Traceback (most recent call last): File "/Users/gentoo/code/openEMS-Project/openEMS/python/Tutorials/MSL_NotchFilter.py", line 103, in <module> FDTD.Run(Sim_Path, cleanup=True) File "openEMS/openEMS.pyx", line 489, in openEMS.openEMS.openEMS.Run AssertionError This is caused by an oversight of an assertion in openEMS.pyx: os.chdir(sim_path) # ... assert os.getcwd() == sim_path The problem here is that "sim_path" is not a canonical path name, so the assertion would fail if the path we're switching into contains a symbolic link. This problem affects all operating systems, it's not limited to macOS. But on macOS, the problem is especially serious, since macOS's "/tmp" is a link to "/private/tmp" by default. Thus, it causes an AssertionError in all the included Python examples. Instead of doing "assert os.getcwd() == sim_path", we should write "assert os.getcwd() == os.path.realpath(sim_path)" to ensure that we're checking a canonical path. Signed-off-by: Yifeng Li <tomli@tomli.me> |
||
---|---|---|
Analyse | ||
Common | ||
FDTD | ||
TESTSUITE | ||
cmake/Modules | ||
linux | ||
matlab | ||
nf2ff | ||
python | ||
tools | ||
.gitattributes | ||
.gitignore | ||
CMakeLists.txt | ||
COPYING | ||
Doxyfile | ||
INSTALL | ||
NEWS | ||
README | ||
TODO | ||
astyle.sh | ||
known_bugs | ||
known_problems | ||
main.cpp | ||
openEMS.sh | ||
openEMS_MPI.sh | ||
openems.cpp | ||
openems.h | ||
openems_global.h |
README
* * openEMS - a free and open electromagnetic field solver * * Copyright (C) 2010-2015 Thorsten Liebig * openEMS is licensed under the terms of the GPLv3, see <http://www.gnu.org/licenses/>. Website: http://openems.de Forum: http://openems.de/forum/ Tutorials: http://openems.de/index.php/Tutorials To use openEMS from Matlab or Octave, you need to include the <openEMS-install-folder>/matlab folder in the respective environment: > addpath( '<openEMS-install-folder>/matlab' ); To verify the correct installation follow the instructions at: http://openems.de/index.php/Tutorial:_First_Steps