BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Py::Export Namespace Reference

Description

Wraps methods that serialize objects to Python.

Functions

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

Function Documentation

◆ sampleCode()

std::string Py::Export::sampleCode ( const MultiLayer sample)

Definition at line 20 of file ExportToPython.cpp.

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

References SampleToPython::sampleCode().

Here is the call graph for this function:

◆ simulationPlotCode()

std::string Py::Export::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().

Here is the call graph for this function:

◆ simulationSaveCode()

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

Definition at line 30 of file ExportToPython.cpp.

31 {
32  return SimulationToPython().simulationSaveCode(simulation, fname);
33 }
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: