TELEMETRY ENGINE
A repository for the calculation of telemetry data.
Table of Contents
Local Development
This section contains instructions on setting up the stack on a local machine and manual setup.
Requirements
- Python
- django
- pytest-django
Instructions:
-
Pull the Telemetry Engine Repository which includes the complete django stack existing in the directory
-
Navigate into the
telemetry_engine
directory. -
Create a new virtual environment with
python3 -m venv venv
-
Activate the virtual environment with
source .venv/bin/activate
-
Install the dependencies with
pip install -r requirements.txt
-
Run the migrations with
python3 manage.py migrate
-
Seed the database with
python3 manage.py shell < seed.py
(optional) -
The application can also be tested by running
pytest
-
To get terminals with average telemetry in northern hemisphere -
python3 manage.py shell
- ```python from device.models import Terminal, Telemetry from django.db.models import Avgavg_terminal_telemetry = Terminal.objects.annotate( avg_longitude=Avg('terminal_telemetry__longitude'), avg_latitude=Avg('terminal_telemetry__latitude') ) northern_hemisphere_terminals = avg_terminal_telemetry.filter(avg_latitude__gte=0) print(f'Terminals in northern hemisphere: {northern_hemisphere_terminals}') ```