Improve the construction of a 'Sample' from a Python script
Construction of a Sample
from a Python script is redesingned and fatal bugs are eliminated.
Based on the recent changes in the SWIG layer, the task of obtaining a Sample
from a Python script is divided into two parts:
- Reading and running the Python script, performed in
PyCore/Embed/PyInterpreter
module. - Constructing a C++
Sample
instance from a PythonSample
instance, performed in the SWIG layerlibBornAgainSample.i
.
This redesign leads to some simplifications and improvements in the BornAgain structure:
- The module
PyCore/Sample/ImportSample
is not needed. - The extra SWIG header file
swig_runtime.h
is not needed. - The extraction of the C++
Sample
instance from the Python object is performed in theSample
module (not in thePyCore
module).
The module PyCore/Embed/PyInterpreter
is reviewed and improved.
The initialization and finalization of the embedded Python interpreter is performed properly.
Tests are done with Python scripts under Linux.
Resolves issue #1028 (closed)