FG DES
libFAUDES
DESTool
LRT >>
EEI >>
About
User Reference
C++ API
Lua API
Python API
Developer
Links
libFAUDES
C++ API
Sections
Sets
Generators
Functions
PlugIns
Tutorials
Index
Classes
Files
pbp_include.h
Go to the documentation of this file.
1
/** @file pbp_include.h Includes all luabindings plug-in headers */
2
3
/*
4
****************************************************
5
Convenience header file that includes all headers
6
relevant to the pybindings plug-in.
7
8
(c) Thomas Moor 2023 - 2026
9
****************************************************
10
*/
11
12
13
#ifndef FAUDES_PBP_INCLUDE_H
14
#define FAUDES_PBP_INCLUDE_H
15
16
// include all headers for this plugin
17
#include "
pbp_addons.h
"
18
19
20
/**
21
22
@defgroup PybindingsPlugin Python Bindings Plug-In
23
24
25
@ingroup AllPlugins
26
27
<p>
28
This plug-in implements libFAUDES bindings for the scripting language
29
<a href="https://www.python.org">Python</a>.
30
Relevant libFAUDES data types and functions as documented via the <a href="https://fgdes.tf.fau.de/faudes/reference">libFAUDES User Reference</a>
31
can be accessed from within the Python interpreter.
32
For user documentation/introduction specifically for the faudes Python module,
33
see the
34
<a href="https://fgdes.tf.fau.de/faudes/pythonmod">libFAUDES Python API</a>.
35
<p>
36
37
38
</p>
39
The most convenient method
40
to make the faudes Python module available is to install it via <tt>pip</tt>; i.e., for
41
Linux and macOS
42
</p>
43
44
@code{.unparsed}
45
$ pip install faudes
46
$ python3 -c "import faudes; print(faudes.Version())"
47
@endcode
48
49
or, for native Windows
50
51
@code{.unparsed}
52
> py -m pip install faudes
53
> py -c "import faudes; print(faudes.Version())"
54
@endcode
55
56
<p>
57
This will search the index <a href="https://pypi.org/project/faudes/">PyPI</a>
58
for a binary distribution that fits your platform/archirectur. In the case
59
no such matching binary is present, please let us know. Instructions on how
60
to compile your own binary are below.
61
</p>
62
63
64
65
66
@subsection SecPybindingsIntro1 Example Script
67
68
@code{.unparsed}
69
# load libFAUDES bindings
70
from faudes import *
71
72
# test
73
Version()
74
Build()
75
76
# instantiate generator from Python lists
77
g = Generator.NewFromLists(
78
delta=[
79
['idle', 'alpha', 'busy'],
80
['busy', 'beta', 'idle']],
81
Q0 =[ 'idle' ],
82
Qm =[ 'idle' ]
83
)
84
85
# show on console
86
g.Write()
87
88
# show graphically, i.e., in Jupyter notebook
89
g.GraphShow()
90
@endcode
91
92
<p>
93
Note: for graphics output you must have installed <tt>dot</tt> from the GraphViz package.
94
If <tt>dot</tt> is not in the systems path, you may direct libFAUDES via
95
</p>
96
97
@code{.unparsed}
98
DocPath("/wherever_dot_is/dot").
99
@endcode
100
101
102
103
@subsection SecPybindingsIntro3 Building the libFAUDES Python Modeul
104
105
<p>
106
The faudes Python module consists of the glue code <tt>faudes.py</tt> and a suitably
107
extended libFAUDES shrared object <tt>_faudes.so</tt> (or <tt>_faudes.pyd</tt> for Windows).
108
Both files are generated by the libFAUDES build system; see
109
<a href="../faudes_build.html">build-system documentation</a> for details.
110
Manualy copying/renaming both files to a project folder enables the import of the
111
faudes module from Python scripts in that folder.
112
</p>
113
114
<p>
115
Example for the overall build process incl. copy/rename:
116
<p>
117
118
@code{.unparsed}
119
./libFAUDES$ make dist-clean
120
./libFAUDES$ make -j configure
121
./libFAUDES$ make -j
122
./libFAUDES$ cp plugings/pybindings/obj/faudes.py whereever/
123
./libFAUDES$ cp plugings/pybindings/obj/_faudes.so whereever/
124
./libFAUDES$ cd whereever
125
./whereever$ python3 -c "import faudes; print(faudes.Version())"
126
@endcode
127
128
<p>
129
The above method is specifically recommended for MSYS environments where pip install
130
from PyPI.org will fail.
131
</p>
132
133
134
@subsection SecPybindingsIntro4 Building the Module as Python Wheel
135
136
<p>
137
A <i>Python wheel</i> is an archive in a clearly defined format/layout which
138
among others facilitates binary distribution of Python extenstions e.g. via PyPI.org.
139
The libFAUDES build system has the dedicated target <tt>pybindings-wheel</tt>
140
that utilises the Python module <tt>build</tt> to generate a Python wheel
141
<tt>faudes-*.whl</tt>. The latter can be installed via <tt>pip</tt>.
142
The benefit of this approach is that Python <tt>build</tt> takes care of matching
143
toolchains etc. and that after installing the the module files do not need
144
to be copied to each relevant project folder.
145
The downside is that Python <tt>build</tt> wont use parallel jobs and therefore
146
can take quite some time.
147
</p>
148
149
<p>
150
Example for the overall build process incl. installation:
151
<p>
152
153
@code{.unparsed}
154
./libFAUDES$ make dist-clean
155
./libFAUDES$ make -j configure
156
./libFAUDES$ make pybindings-wheel
157
./libFAUDES$ pip install faudes-2.34.0-cp314-cp314-macosx_10_15_universal2.whl
158
@endcode
159
160
<p>
161
Alternatively, you may download the configured source from PyPI and invoke <tt>build</tt>
162
directly; e.g. for Windows with official Python distribution and MSVC installed
163
</p>
164
@code{.unparsed}
165
./faudes-2.34> py -m build --wheel --outdir=./
166
@endcode
167
168
169
<p>
170
Again, this method is of specific interest for MSYS environments where pip install
171
from PyPI.org will fail. You will need to install the matching Python module <tt>build</tt>
172
via the MSYS package manager <tt>pacman</tt>.
173
</p>
174
175
176
@subsection PyLicense License
177
178
The Python bindings plug-in is distributed with libFAUDES.
179
All code is provided under terms of the LGPL.
180
181
182
Copyright (c) 2023 - 2026 Thomas Moor.
183
184
185
186
*/
187
188
189
190
#endif
pbp_addons.h
libFAUDES 2.34g
--- 2026.04.09 --- c++ api documentaion by
doxygen
>>
C++ API
Introduction
Sets
Generators
Functions
PlugIns
Tutorials
Classes
Files
Top of Page