From 5ccf6b8d7967d77b528cc953109205e919a824fd Mon Sep 17 00:00:00 2001 From: wendtalexander Date: Fri, 13 Jan 2023 13:59:36 +0100 Subject: [PATCH 1/3] adding clases for behavioral readout --- code/behavior.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 code/behavior.py diff --git a/code/behavior.py b/code/behavior.py new file mode 100644 index 0000000..479643f --- /dev/null +++ b/code/behavior.py @@ -0,0 +1,25 @@ +from pathlib import Path +import os +import numpy as np +from IPython import embed + +from pandas import read_csv + + + +class Behavior: + def __init__(self, datapath: str): + csv_file = str(sorted(Path(datapath).glob('**/*.csv'))[0]) + self.dataframe = read_csv(csv_file, delimiter=',') + + embed() + + +def main(datapath:str): + behavior = Behavior(datapath) + + +if __name__ == '__main__': + # Path to the data + datapath = '../data/mount_data/2020-03-13-10_00/' + main(datapath) From c7934680f9210e194d1fac25f61b3e1d97e4946a Mon Sep 17 00:00:00 2001 From: wendtalexander Date: Fri, 13 Jan 2023 14:03:04 +0100 Subject: [PATCH 2/3] removing embed --- code/behavior.py | 1 - 1 file changed, 1 deletion(-) diff --git a/code/behavior.py b/code/behavior.py index 479643f..4009c28 100644 --- a/code/behavior.py +++ b/code/behavior.py @@ -12,7 +12,6 @@ class Behavior: csv_file = str(sorted(Path(datapath).glob('**/*.csv'))[0]) self.dataframe = read_csv(csv_file, delimiter=',') - embed() def main(datapath:str): From 8a83800242579709750addd9e414de6aafc1db15 Mon Sep 17 00:00:00 2001 From: wendtalexander Date: Fri, 13 Jan 2023 15:07:10 +0100 Subject: [PATCH 3/3] adding comments to the pull request --- .vscode/settings.json | 3 +++ code/behavior.py | 11 +++-------- 2 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3516cb9 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.formatting.provider": "autopep8" +} \ No newline at end of file diff --git a/code/behavior.py b/code/behavior.py index 4009c28..b89a28a 100644 --- a/code/behavior.py +++ b/code/behavior.py @@ -1,20 +1,15 @@ from pathlib import Path -import os -import numpy as np -from IPython import embed - from pandas import read_csv - class Behavior: - def __init__(self, datapath: str): + def __init__(self, datapath: str) -> None: csv_file = str(sorted(Path(datapath).glob('**/*.csv'))[0]) self.dataframe = read_csv(csv_file, delimiter=',') - -def main(datapath:str): +def main(datapath: str): + # behabvior is pandas dataframe with all the data behavior = Behavior(datapath)