diff --git a/emfit/__main__.py b/emfit/__main__.py deleted file mode 100644 index 1e6012f..0000000 --- a/emfit/__main__.py +++ /dev/null @@ -1,23 +0,0 @@ -from emfit import get_datas - -for e in get_datas(): - # print("-------") - print(f"{e.end} {e.measured_hr_avg} {e.summary}") - - -# TODO get average HR -# TODO get 'quality', that is amount of time it actually had signal - -from kython.plotting import plot_timestamped -everything = get_datas() -tss = [e.end for e in everything] -hrs = [e.measured_hr_avg for e in everything] - -plot_timestamped( - tss, - hrs, - ratio=(15, 3), - mavgs=[(5, 'blue'), (10, 'green')], - marker='.', - ylimits=[40, 70], - ).savefig('hrs.png') diff --git a/plot.py b/plot.py index ade18be..87ec6e8 100755 --- a/plot.py +++ b/plot.py @@ -1,11 +1,3 @@ -#!/usr/bin/env python3 -import matplotlib.dates as md # type: ignore -import numpy as np # type: ignore -import seaborn as sns # type: ignore -import matplotlib.pyplot as plt # type: ignore - -from emfit import get_datas - # def stats(): # for jj in iter_datas(): # # TODO fimezone?? @@ -24,27 +16,10 @@ from emfit import get_datas # print(*res) -def plot_hr_trend(): - everything = get_datas() - tss = [e.end for e in everything] - hrs = [e.measured_hr_avg for e in everything] - plt.figure(figsize=(15,4)) - ax = sns.pointplot(tss, hrs) # , markers=" ") - # TODO wtf is that/?? - ax.set(ylim=(None, 70)) - - plt.show() - -# TODO ok, would be nice to have that every morning in timeline -# also timeline should have dynamic filters? maybe by tags # then I could enable emfit feed and slog feed (pulled from all org notes) and see the correlation? also could pull workouts provider (and wlog) -- actually wlog processing could be moved to timeline too -plot_hr_trend() - - # TODO maybe rmssd should only be computed if we have a reasonable chunk of datas -# plot_timestamped([p[0] for p in pts], [p[1] for p in pts], mavgs=[]).savefig('res.png') # TODO X axes: show hours and only two dates # TODO 4 is awake, 3 REM, 2 light, 1 deep