alina chart

This commit is contained in:
Lucas Faber authored and Lucas Vivohost committed 2026-09-14 09:20:47 +02:00
1 parent 3e258c6afe
commit 74a3cfe8ed
2 files changed
+22 -3

No files matched your search

+20 -3
View File
@@ -1,6 +1,7 @@
import pandas as pd
import matplotlib.pyplot as plt
import os
import socket
def interpolate_daily(df):
df = df.copy()
@@ -66,9 +67,19 @@ def plot_percentiles(ax, x, data_dict, p_keys, colors=None, linewidths=None, lab
return ax
hostname = socket.gethostname()
if hostname == "quiethost":
# Build output path from ods_path
ods_path = "/data/Nextcloud/Documents/Dokumente/Shared/Alina/WachstumsDatenWHO.ods"
csv_path = "/data/Nextcloud/Documents/Dokumente/Shared/Alina/WachstumAlina.csv"
ods_path = "/data/Nextcloud/Documents/Dokumente/Shared/Alina/Wachstum/WachstumsDatenWHO.ods"
csv_path = "/data/Nextcloud/Documents/Dokumente/Shared/Alina/Wachstum/WachstumAlina.csv"
elif hostname == "serverhost":
print("Serverhost Mode")
import subprocess
subprocess.run(["bash", "/home/lucas/scripts/serverhost/syncNC.sh", "-al"])
ods_path = "/home/lucas/Documents/Dokumente/Shared/Alina/Wachstum/WachstumsDatenWHO.ods"
csv_path = "/home/lucas/Documents/Dokumente/Shared/Alina/Wachstum/WachstumAlina.csv"
output_dir = os.path.dirname(ods_path)
output_path = os.path.join(output_dir, "WachstumAlina.png")
@@ -101,7 +112,7 @@ who_weight_daily = interpolate_daily(who_weight_df)
who_height_daily = interpolate_daily(who_height_df)
who_head_daily = interpolate_daily(who_head_df)
print(alina_df["Datum"])
# Plot
last_alina_date = alina_df["Datum"].max() + pd.DateOffset(months=2)
x = who_weight_daily["Datum"][who_weight_daily["Datum"] <= last_alina_date]
@@ -247,4 +258,10 @@ plt.tight_layout()
plt.savefig(output_path, dpi=150)
plt.close()
if hostname == "serverhost":
print("Serverhost Mode")
import subprocess
subprocess.run(["bash", "/home/lucas/scripts/serverhost/syncNC.sh", "-al"])
print("Fin")