BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ExportToPython Namespace Reference

Wraps methods that serialize objects to Python. More...

Functions

std::string sampleCode (const MultiLayer &multilayer)
 
std::string simulationPlotCode (const ISimulation &simulation)
 
std::string simulationSaveCode (const ISimulation &simulation, const std::string &fname)
 

Detailed Description

Wraps methods that serialize objects to Python.

Function Documentation

◆ sampleCode()

std::string ExportToPython::sampleCode ( const MultiLayer multilayer)

Definition at line 20 of file ExportToPython.cpp.

21 {
22  return SampleToPython().sampleCode(multilayer);
23 }
Generates Python code snippet from domain (C++) objects representing sample construction.
std::string sampleCode(const MultiLayer &multilayer)

References SampleToPython::sampleCode().

Referenced by PySampleWidget::generateCodeSnippet().

Here is the call graph for this function:

◆ simulationPlotCode()

std::string ExportToPython::simulationPlotCode ( const ISimulation simulation)

Definition at line 25 of file ExportToPython.cpp.

26 {
27  return SimulationToPython().simulationPlotCode(simulation);
28 }
Write a Python script that allows to run the current simulation.
std::string simulationPlotCode(const ISimulation &simulation)
Returns a Python script that runs a simulation and plots the result.

References SimulationToPython::simulationPlotCode().

Referenced by PythonScriptWidget::generatePythonScript().

Here is the call graph for this function:

◆ simulationSaveCode()

std::string ExportToPython::simulationSaveCode ( const ISimulation simulation,
const std::string &  fname 
)

Definition at line 30 of file ExportToPython.cpp.

32 {
33  return SimulationToPython().simulationSaveCode(simulation, fname);
34 }
std::string simulationSaveCode(const ISimulation &simulation, const std::string &fname)
Returns a Python script that runs a simulation and saves the result to a file.

References SimulationToPython::simulationSaveCode().

Here is the call graph for this function: