Ariles
Loading...
Searching...
No Matches
python.h
Go to the documentation of this file.
1/**
2 @file
3 @author Alexander Sherikov
4
5 @copyright 2017-2026 Alexander Sherikov, Licensed under the Apache License, Version 2.0.
6 (see @ref LICENSE or http://www.apache.org/licenses/LICENSE-2.0)
7
8 @brief
9*/
10
11/**
12@defgroup python Python
13@ingroup config
14
15@brief Python serialization.
16
17@brief Outputs a Python script that defines variables containing data exported by ariles.
18Script includes all necessary imports and is intended to be loaded in other python scripts
19or interactive sessions using `exec(open("output_script.py").read())`. Ariles class exported
20using 'python' visitor is a single python map similar to this:
21`root_element={'vector': [1, 2, 3], 'vector_of_maps': [{'a': 'a'}], 'scalar': 2}`,
22i.e.: ariles maps correspond to python dictionaries, arrays to python arrays, matrices and
23vectors should be represented using numpy types.
24
25@note This visitor only supports writing (serialization) as reading Python files properly
26requires a full Python parser which is beyond the scope of this library.
27*/
28
29
30#pragma once
31
32#define ARILES2_VISITOR_INCLUDED_python
33
36
37
38#include "./python/writer.h"
39
40
41namespace ariles2
42{
43 /**
44 * @brief Python visitor.
45 * @ingroup python
46 */
47 struct python
48 {
50
52
53 // Python visitor is write-only; reading Python files requires a full Python parser
54 // The Reader type is defined but not implemented for interface compatibility
55 };
56} // namespace ariles2
Configuration writer class.
Definition writer.h:27
Python visitor.
Definition python.h:48