From 7593b7e9ead1b0843a697f7f56d6212e87e8cff0 Mon Sep 17 00:00:00 2001 From: Chooi Je Qin <42904912+jeqinchooi@users.noreply.github.com> Date: Sat, 7 Oct 2023 19:51:14 -0400 Subject: [PATCH 1/4] Added a read_csv function that reads input and output csv files and writes the Pandas dataframe to console --- ersilia/core/tracking.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ersilia/core/tracking.py b/ersilia/core/tracking.py index 25da8f77..49567066 100644 --- a/ersilia/core/tracking.py +++ b/ersilia/core/tracking.py @@ -1,3 +1,6 @@ +import pandas as pd + + class RunTracker: """ This class will be responsible for tracking model runs. It calculates the desired metadata based on a model's @@ -6,12 +9,19 @@ class RunTracker: NOTE: Currently, the Splunk connection is not set up. For now, we will print tracking results to the console. """ + def read_csv(self, file): + # reads csv file and returns Pandas dataframe + return pd.read_csv(file) + def track(self, input, result, meta): """ Tracks the results after a model run. """ print("Run input file:", input) + print(self.read_csv(input)) + print("Run output file:", result) + print(self.read_csv(result)) - print("Model metadata:", meta) \ No newline at end of file + print("Model metadata:", meta) From 8ad5c0ed8d821892bc1f33fb2211da83704e998b Mon Sep 17 00:00:00 2001 From: Chooi Je Qin <42904912+jeqinchooi@users.noreply.github.com> Date: Sun, 8 Oct 2023 13:23:49 -0400 Subject: [PATCH 2/4] add pandas to requirementes --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 9eb07620..c3863d9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,7 @@ sphinx = {version = ">=5.3.0", optional = true} # For compatibility with python jinja2 = {version = "^3.1.2", optional = true} levenshtein = {version = ">=0.21.1,<0.23.0", optional = true} # For faster fuzzy search boto3 = "^1.28.40" +pandas = "^2.1.1" [tool.poetry.extras] From e29b28b24b96d88f98edc19e235c8133c93f69c0 Mon Sep 17 00:00:00 2001 From: Chooi Je Qin <42904912+jeqinchooi@users.noreply.github.com> Date: Sun, 8 Oct 2023 13:25:51 -0400 Subject: [PATCH 3/4] Downgrade pandas to 2.0.3 as allowed --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c3863d9c..624c526a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ sphinx = {version = ">=5.3.0", optional = true} # For compatibility with python jinja2 = {version = "^3.1.2", optional = true} levenshtein = {version = ">=0.21.1,<0.23.0", optional = true} # For faster fuzzy search boto3 = "^1.28.40" -pandas = "^2.1.1" +pandas = "^2.0.3" [tool.poetry.extras] From 974db8c42f91819dd619e9ee8addc03a28c9af95 Mon Sep 17 00:00:00 2001 From: Chooi Je Qin <42904912+jeqinchooi@users.noreply.github.com> Date: Sun, 8 Oct 2023 13:37:26 -0400 Subject: [PATCH 4/4] Downgrade pandas to 2.0.3 as allowed --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 624c526a..f64a7a5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,10 @@ validators = [ {version="0.20.0", python="3.7.*"}, {version="~0.21.0", python=">=3.8"}, ] +pandas = [ + {version="1.2.4", python="3.7.*"}, + {version="~1.3.0", python=">=3.8"}, +] h5py = "^3.7.0" # For compatibility with isaura loguru = "^0.6.0" # For compatibility with isaura pyairtable = "<2" @@ -49,7 +53,6 @@ sphinx = {version = ">=5.3.0", optional = true} # For compatibility with python jinja2 = {version = "^3.1.2", optional = true} levenshtein = {version = ">=0.21.1,<0.23.0", optional = true} # For faster fuzzy search boto3 = "^1.28.40" -pandas = "^2.0.3" [tool.poetry.extras]