Architecture
The hierarchy between the three parts of Pyra:
Inside Pyra Core's main loop:
- The Core will infinitely loop over the modules
MeasurementConditions
,EnclosureControl
,SunTracking
,OpusMeasurements
, andSystemChecks
- The Core will start the Upload- and Helios-Thread when they should be running but are not
- The threads will stop themselves based on the config
The communication via the state.json
file:
Pyra Core Directory Structure
Responsibilities
types
contains all types used in the codebase. The whole codebase has static-type hints. A static-type analysis can be done using MyPy (seescripts/
).utils
contains all supporting functionality used in one or more places.interfaces
includes the "low-level" code to interact with the PLC, the operating system, and the config- and state files.modules
contains the steps Pyra Core runs sequentially on the main thread.threads
contains the logic that Pyra Core runs parallel to the main thread.
Import hierarchy
graph LR;
A["types"] -- imported by --> B;
B["utils"] -- imported by --> C;
C["interfaces"] -- imported by --> D;
C -- imported by --> E;
D["modules"] -- imported by --> F;
E["threads"] -- imported by --> F["main.py"];
* the graph is transient