Going further
Imports
When your application becomes complex, you may want to split it into digestible and reusable parts. import
is a special keyword you can use to combine multiple YAML files into one application.
A few examples are available here: import.yaml, import2.yaml, import3.yaml. They are self-explanatory.
Templates
You can add logic to your YAML files, make your apps configurable, and manipulate variables. Timeflux uses Jinja under the hood.
Take the following app.yaml example:
graphs:
- nodes:
- id: my_node
module: my_module
class: {{ FOOBAR }}
Setting an environment variable and invoking Timeflux:
timeflux -e FOOBAR="MyClass" app.yaml
Will render the template as:
graphs:
- nodes:
- id: my_node
module: my_module
class: MyClass
You are not limited to mere variable substitution. You have the full power of Jinja at your disposal, including control structures, macros, filters, and more.
Nodes
Explore the API reference for a list of available nodes and the test/graphs directory of the corresponding GitHub repositories for examples.
Tools
Useful tools and helpers can be found here: timeflux.helpers
.
In particular, you may want to have a look at:
timeflux.helpers.viz
to generate images from applications, which is very useful to visually debug your applicationtimeflux.helpers.handler
if you need to deploy experiments on Windows systems and need to integrate with other software componentstimeflux.helpers.lsl
to enumerate available LSL streams
If you are developing plugins:
timeflux.helpers.clock
has a set of functions to manipulate timetimeflux.helpers.testing
is useful to generate dummy data and simulate the graph scheduler for unit testing
Interfaces
Todo
Work in progress!
The timeflux_ui plugin exposes a powerful JavaScript API to build web apps and interact with Timeflux instances from a browser. Extensive documentation is on its way. Meanwhile, we invite you to explore the available example apps.