Skip to content

Commit

Permalink
Clean up code slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
AC-Dap committed Oct 17, 2023
1 parent 801ef9e commit 6d09d83
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,6 @@ dmypy.json

# Cython debug symbols
cython_debug/

# Don't commit .csv output files
*.csv
11 changes: 4 additions & 7 deletions ersilia/core/tracking.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from datetime import datetime
import json
import statistics
import pandas as pd


Expand All @@ -27,7 +26,7 @@ def stats(self, result):
dat = self.read_csv(result)

# drop first two columns (key, input)
dat = dat.drop(['key','input'], axis = 1)
dat = dat.drop(["key", "input"], axis=1)

# calculate and print statistics
for column in dat:
Expand All @@ -41,7 +40,6 @@ def stats(self, result):
print("Standard deviation %s: %s" % (column, dat[column].std()))

def track(self, input, result, meta):

"""
Tracks the results after a model run.
"""
Expand All @@ -56,13 +54,12 @@ def track(self, input, result, meta):
time = datetime.now() - self.time_start
print("Time taken:", time)

print(self.stats(result))
self.stats(result)

def log_to_console(self, data):
print(f"\n{json.dumps(data)}\n")


def read_json(self, result):
data = json.load(result)
self.log_to_console(result)
return data
return data
5 changes: 0 additions & 5 deletions my_molecules.csv

This file was deleted.

6 changes: 0 additions & 6 deletions my_molecules_output.csv

This file was deleted.

0 comments on commit 6d09d83

Please sign in to comment.