BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
PyFmt.h File Reference

Description

Defines namespace pyfmt.

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 PyFmt.h.

Include dependency graph for PyFmt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Py
 
 Py::Fmt
 Utility functions for writing Python code snippets.
 

Macros

#define BORNAGAIN_BASE_PY_PYFMT_H
 

Functions

std::string Py::Fmt::indent (size_t width=4u)
 Returns a string of blanks with given width. By default the width equals standard offset in python files. More...
 
bool Py::Fmt::isHexagonal (double length1, double length2, double angle)
 
bool Py::Fmt::isSquare (double length1, double length2, double angle)
 
std::string Py::Fmt::printArguments (const std::vector< std::pair< double, std::string >> &arguments)
 Takes pairs of value/unit and concatenates them for an argument list. Each pair's content will be processed by printValue(), so the meaning of the content is the same as in printValue(). More...
 
std::string Py::Fmt::printArguments (const std::vector< std::pair< std::variant< double, int >, std::string >> &arguments)
 Convenience overload for printing arguments containing a mixture of int and double. More...
 
std::string Py::Fmt::printBool (double value)
 
std::string Py::Fmt::printDegrees (double input)
 
std::string Py::Fmt::printDouble (double input)
 
std::string Py::Fmt::printFunction (const std::string &name, const std::vector< std::pair< double, std::string >> &arguments)
 Print a function in the form "<name>(<arguments>)". arguments will be processed by printArguments(), see there for details. More...
 
std::string Py::Fmt::printFunction (const std::string &name, double value, const std::string &unit)
 Convenience overload for printing a function with one argument. More...
 
std::string Py::Fmt::printFunction (const std::string &name, double value1, const std::string &unit1, double value2, const std::string &unit2)
 Convenience overload for printing a function with two arguments. More...
 
std::string Py::Fmt::printImportedSymbols (const std::string &code)
 
std::string Py::Fmt::printInt (int value)
 
std::string Py::Fmt::printKvector (const R3 value)
 
std::string Py::Fmt::printLightDouble (double input)
 prints double as an integer, if possible within standard accuracy More...
 
std::string Py::Fmt::printNm (double input)
 
std::string Py::Fmt::printNm2 (double input)
 
std::string Py::Fmt::printScientificDouble (double input)
 
std::string Py::Fmt::printString (const std::string &value)
 
std::string Py::Fmt::printValue (double value, const std::string &units)
 
std::string Py::Fmt::printValue (std::variant< double, int > value, const std::string &units)
 

Macro Definition Documentation

◆ BORNAGAIN_BASE_PY_PYFMT_H

#define BORNAGAIN_BASE_PY_PYFMT_H

Definition at line 21 of file PyFmt.h.