add my.body.sleep, combine together emfit/jawbone

This commit is contained in:
Dima Gerasimov 2020-10-09 22:34:38 +01:00 committed by karlicoss
parent e8e4994c02
commit 725597de97
5 changed files with 29 additions and 2 deletions

17
my/body/sleep/common.py Normal file
View file

@ -0,0 +1,17 @@
from ...core import stat, Stats
from ...core.pandas import DataFrameT, check_dataframe as cdf
class Combine:
def __init__(self, modules) -> None:
self.modules = modules
@cdf
def dataframe(self) -> DataFrameT:
import pandas as pd # type: ignore
# todo include 'source'?
df = pd.concat([m.dataframe() for m in self.modules])
return df
def stats(self) -> Stats:
return stat(self.dataframe)