BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
PyImport.h File Reference

Defines PyImport namespace. More...

Go to the source code of this file.

Functions

std::unique_ptr< MultiLayerPyImport::createFromPython (const std::string &script, const std::string &functionName, const std::string &path="")
 Creates a multi layer by running python code in embedded interpreter. More...
 
std::vector< std::string > PyImport::listOfFunctions (const std::string &script, const std::string &path="")
 Returns list of functions defined in the script. More...
 

Detailed Description

Defines PyImport namespace.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file PyImport.h.

Function Documentation

◆ createFromPython()

std::unique_ptr< MultiLayer > PyImport::createFromPython ( const std::string &  script,
const std::string &  functionName,
const std::string &  path = "" 
)

Creates a multi layer by running python code in embedded interpreter.

Parameters
scriptPython script
functionNameA function name in this script which produces a MultiLayer
pathA path to import BornAgain library. If empty, relies on PYTHONPATH

Definition at line 35 of file PyImport.cpp.

◆ listOfFunctions()

std::vector< std::string > PyImport::listOfFunctions ( const std::string &  script,
const std::string &  path = "" 
)

Returns list of functions defined in the script.

Parameters
scriptPython script
pathA path to import BornAgain library. If empty, relies on PYTHONPATH

Definition at line 87 of file PyImport.cpp.