Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions
shamrock_json_to_py_json.hpp File Reference

Utilities to convert JSON objects to Python objects and vice versa. TODO: try to convert directly without using string parsing. More...

#include "nlohmann/json.hpp"
#include "shambindings/pybindaliases.hpp"
#include "shambindings/pytypealias.hpp"
+ Include dependency graph for shamrock_json_to_py_json.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  shammodels
 namespace for models
 

Functions

template<class T >
py::object shammodels::common::to_py_json (const T &self)
 
template<class T >
shammodels::common::from_py_json (py::object json_data)
 
template<class TConfig >
void shammodels::common::add_json_defs (py::class_< TConfig > &cls)
 

Detailed Description

Utilities to convert JSON objects to Python objects and vice versa. TODO: try to convert directly without using string parsing.

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file shamrock_json_to_py_json.hpp.

Function Documentation

◆ add_json_defs()

template<class TConfig >
void shammodels::common::add_json_defs ( py::class_< TConfig > &  cls)
inline

Definition at line 40 of file shamrock_json_to_py_json.hpp.

◆ from_py_json()

template<class T >
T shammodels::common::from_py_json ( py::object  json_data)
inline

Definition at line 33 of file shamrock_json_to_py_json.hpp.

◆ to_py_json()

template<class T >
py::object shammodels::common::to_py_json ( const T &  self)
inline

Definition at line 26 of file shamrock_json_to_py_json.hpp.