Sample cannot be imported from script
- create file .py with sample script:
def get_sample():
# Define materials
material_Default = ba.RefractiveMaterial("Default", 0.001, 1e-05)
# Define layers
layer_1 = ba.Layer(material_Default)
# Define sample
sample = ba.MultiLayer()
sample.addLayer(layer_1)
return sample
- build BA
- add
build/py/src
to PYTHONPATH - run GUI
- import sample from Py --> Segmentation fault
Broken by MR !2724 (merged)
backtrace
Thread 1 "bornagain" received signal SIGSEGV, Segmentation fault.
_PyInterpreterState_GET () at ./Include/internal/pycore_pystate.h:116
116 ./Include/internal/pycore_pystate.h: No such file or directory.
(gdb) bt
#0 _PyInterpreterState_GET () at ./Include/internal/pycore_pystate.h:116
#1 get_list_state () at Objects/listobject.c:24
#2 PyList_New (size=0) at Objects/listobject.c:165
#3 0x00007ffff427d3ab in PyImport_Import (module_name=module_name@entry=0x7fffb8044030)
at Python/import.c:1984
#4 0x00007ffff427d60a in PyImport_ImportModule (name=<optimized out>) at Python/import.c:1453
#5 0x00007ffff77f8434 in PyInterpreter::BornAgain::import(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
from /home/mikhail/Projects/bornagain/build/lib/_libBornAgainPyCore.so
#6 0x00007ffff77f8633 in PyInterpreter::BornAgain::importScript(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
from /home/mikhail/Projects/bornagain/build/lib/_libBornAgainPyCore.so
#7 0x00007ffff77f878e in PyInterpreter::BornAgain::listOfFunctions(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
from /home/mikhail/Projects/bornagain/build/lib/_libBornAgainPyCore.so
#8 0x00007ffff7aaa52d in IO::Py::importSample() ()
Edited by Mikhail Svechnikov