16 #error no need to expose this header to Swig
20 #ifndef BORNAGAIN_BASE_PY_PYFMT_H
21 #define BORNAGAIN_BASE_PY_PYFMT_H
23 #include <heinz/Vectors3D.h>
38 std::string
printNm(
double input);
42 std::string
printValue(
double value,
const std::string& units =
"");
43 std::string
printValue(std::variant<double, int> value,
const std::string& units =
"");
49 std::string
printArguments(
const std::vector<std::pair<double, std::string>>& arguments);
53 printArguments(
const std::vector<std::pair<std::variant<double, int>, std::string>>& arguments);
58 const std::vector<std::pair<double, std::string>>& arguments);
61 std::string
printFunction(
const std::string& name,
double value,
const std::string& unit);
64 std::string
printFunction(
const std::string& name,
double value1,
const std::string& unit1,
65 double value2,
const std::string& unit2);
67 bool isSquare(
double length1,
double length2,
double angle);
68 bool isHexagonal(
double length1,
double length2,
double angle);
73 std::string
indent(
size_t width = 4u);
Utility functions for writing Python code snippets.
std::string printDegrees(double input)
std::string printDouble(double input)
std::string printLightDouble(double input)
prints double as an integer, if possible within standard accuracy
std::string printString(const std::string &value)
std::string printKvector(const R3 value)
std::string printScientificDouble(double input)
std::string printNm(double input)
bool isHexagonal(double length1, double length2, double angle)
std::string printBool(double value)
std::string indent(size_t width)
Returns a string of blanks with given width. By default the width equals standard offset in python fi...
std::string printNm2(double input)
std::string 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(),...
std::string 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 pro...
std::string printValue(double value, const std::string &units)
bool isSquare(double length1, double length2, double angle)
std::string printImportedSymbols(const std::string &code)
std::string printInt(int value)