24 auto &m = root_module;
29 py::class_<T>(m,
"PhantomDump")
32 [](T &self, std::string fname) {
33 auto file = self.gen_file();
34 file.write_to_file(fname);
38 [](T &self, std::string s) {
39 return self.read_header_float<
f64>(s);
43 [](T &self, std::string s) {
44 return self.read_header_int<
i64>(s);
48 m.def(
"load_phantom_dump", [](std::string fname) {
54 "compare_phantom_dumps",
double f64
Alias for double.
std::int64_t i64
64 bit integer
Class for reading and writing Fortran-style binary files.
FortranIOFile load_fortran_file(const std::string &fname)
Load a Fortran formatted file from disk.
bool compare_phantom_dumps(PhantomDump &dump1, PhantomDump &dump2)
Compare two phantom dumps and report offenses.
Pybind11 include and definitions.
#define ON_PYTHON_INIT
Register a Python module init function using static initialization.
void debug_ln(std::string module_name, Types... var2)
Prints a log message with multiple arguments followed by a newline.
Class representing a Phantom dump file.
static PhantomDump from_file(shambase::FortranIOFile &phfile)
Reads a Phantom dump file and returns a PhantomDump object.
void print_state()
Print current state of the data stored in the class.