feat: add documentation, enable makefile driven usage

This introduces a One-Stop-Shop Makefile.

Also brings back tensorflow as dependency, it is still needed
This commit is contained in:
Daniel Molkentin 2024-09-10 20:34:37 +02:00 committed by drbacke
parent 244a343735
commit c91d29db55
4 changed files with 92 additions and 4 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.venv
docs

38
Makefile Normal file
View File

@ -0,0 +1,38 @@
# Define the targets
.PHONY: help venv pip docs clean
# Default target
all: help
# Target to display help information
help:
@echo "Available targets:"
@echo " venv - Set up a Python 3 virtual environment."
@echo " pip - Install dependencies from requirements.txt."
@echo " docs - Generate HTML documentation using pdoc."
@echo " run - Run flask_server.py in the virtual environment."
@echo " clean - Remove generated documentation and virtual environment."
# Target to set up a Python 3 virtual environment
venv:
python3 -m venv .venv
@echo "Virtual environment created in '.venv'. Activate it using 'source .venv/bin/activate'."
# Target to install dependencies from requirements.txt
pip: venv
.venv/bin/pip install -r requirements.txt
@echo "Dependencies installed from requirements.txt."
# Target to generate HTML documentation
docs: pip
pdoc --html --force modules -o docs
# Clean target to remove generated documentation and virtual environment
clean:
@echo "Cleaning virtual env and documentation directories"
rm -rf docs
rm -rf .venv
run:
@echo "Starting flask server, please wait..."
.venv/bin/python ./flask_server.py

View File

@ -20,14 +20,33 @@ https://www.akkudoktor.net/forum/diy-energie-optimierungssystem-opensource-proje
- `Backend:` Visual Cleaner (z.B. E-Auto Akku = 100%, dann sollte die Lademöglichkeit auf 0 stehen. Zumindest bei der Ausgabe sollte das "sauber" sein) - `Backend:` Visual Cleaner (z.B. E-Auto Akku = 100%, dann sollte die Lademöglichkeit auf 0 stehen. Zumindest bei der Ausgabe sollte das "sauber" sein)
- `Backend:` Cache regelmäßig leeren können (API) - `Backend:` Cache regelmäßig leeren können (API)
## Installation ## Installation
Gute Install Anleitung: Gute Install Anleitung:
https://meintechblog.de/2024/09/05/andreas-schmitz-joerg-installiert-mein-energieoptimierungssystem/ https://meintechblog.de/2024/09/05/andreas-schmitz-joerg-installiert-mein-energieoptimierungssystem/
Das Projekt erfordert Python 3.8 oder neuer. Alle notwendigen Abhängigkeiten können über `pip` installiert werden. Klonen Sie das Repository und installieren Sie die erforderlichen Pakete mit: Das Projekt erfordert Python 3.8 oder neuer.
### Schnellanleitung
Unter Linux (Ubuntu/Debian):
```bash
sudo apt install make
```
Unter Macos (benötigt [Homebrew](https://brew.sh)):
```zsh
brew install make
```
Nun `config.example.py` anpassen und dann in `config.py` umbennenen. Anschließend kann der Server über `make run` gestartet werden.
Eine vollständige Übersicht über die wichtigsten Kurzbefehle gibt `make help`.
### Ausführliche Anleitung
Alle notwendigen Abhängigkeiten können über `pip` installiert werden. Klonen Sie das Repository und installieren Sie die erforderlichen Pakete mit:
```bash ```bash
git clone https://github.com/Akkudoktor-EOS/EOS git clone https://github.com/Akkudoktor-EOS/EOS

View File

@ -1,3 +1,5 @@
absl-py==2.1.0
astunparse==1.6.3
blinker==1.8.2 blinker==1.8.2
certifi==2024.8.30 certifi==2024.8.30
charset-normalizer==3.3.2 charset-normalizer==3.3.2
@ -6,27 +8,54 @@ contourpy==1.3.0
cycler==0.12.1 cycler==0.12.1
deap==1.4.1 deap==1.4.1
Flask==3.0.3 Flask==3.0.3
flatbuffers==24.3.25
fonttools==4.53.1 fonttools==4.53.1
gast==0.6.0
google-pasta==0.2.0
grpcio==1.66.1
h5py==3.11.0
idna==3.8 idna==3.8
itsdangerous==2.2.0 itsdangerous==2.2.0
Jinja2==3.1.4 Jinja2==3.1.4
joblib==1.4.2 joblib==1.4.2
keras==3.5.0
kiwisolver==1.4.7 kiwisolver==1.4.7
libclang==18.1.1
Mako==1.3.5
mariadb==1.1.10 mariadb==1.1.10
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==2.1.5 MarkupSafe==2.1.5
matplotlib==3.9.2 matplotlib==3.9.2
numpy==2.1.1 mdurl==0.1.2
ml-dtypes==0.4.0
namex==0.0.8
numpy==1.26.4
opt-einsum==3.3.0
optree==0.12.1
packaging==24.1 packaging==24.1
pandas==2.2.2 pandas==2.2.2
pdoc3==0.11.1
pillow==10.4.0 pillow==10.4.0
protobuf==4.25.4
Pygments==2.18.0
pyparsing==3.1.4 pyparsing==3.1.4
python-dateutil==2.9.0.post0 python-dateutil==2.9.0.post0
pytz==2024.1 pytz==2024.1
requests==2.32.3 requests==2.32.3
rich==13.8.1
scikit-learn==1.5.1 scikit-learn==1.5.1
scipy==1.14.1 scipy==1.14.1
setuptools==74.1.2
six==1.16.0 six==1.16.0
tensorboard==2.17.1
tensorboard-data-server==0.7.2
tensorflow==2.17.0
termcolor==2.4.0
threadpoolctl==3.5.0 threadpoolctl==3.5.0
typing_extensions==4.12.2
tzdata==2024.1 tzdata==2024.1
urllib3==2.2.2 urllib3==2.2.2
Werkzeug==3.0.4 Werkzeug==3.0.4
wheel==0.44.0
wrapt==1.16.0