Skip to content

Commit

Permalink
Apply automatic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AC-Dap authored and github-actions[bot] committed Oct 27, 2023
1 parent 6e8b47f commit 77a626d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
9 changes: 6 additions & 3 deletions ersilia/cli/commands/close.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ def close():
mdl.close()
echo(":no_entry: Model {0} closed".format(mdl.model_id), fg="green")

#renames current_session to timestamp
# renames current_session to timestamp
old_file_path = "current_session.txt"
new_file_path = os.path.join(os.path.dirname(old_file_path), datetime.datetime.now().strftime('%Y%m%d%H%M%S'))
os.rename(old_file_path, new_file_path)
new_file_path = os.path.join(
os.path.dirname(old_file_path),
datetime.datetime.now().strftime("%Y%m%d%H%M%S"),
)
os.rename(old_file_path, new_file_path)
6 changes: 5 additions & 1 deletion ersilia/cli/commands/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def serve_cmd():
)
# Add the new flag for tracking the serve session
@click.option(
"-t/", "--track_serve/--no_track_serve", "track_serve", required=False, default=True
"-t/",
"--track_serve/--no_track_serve",
"track_serve",
required=False,
default=True,
)
def serve(model, lake, docker, port, track_serve):
if docker:
Expand Down
7 changes: 3 additions & 4 deletions ersilia/core/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ def track(self, input, result, meta):
self.stats(result)

self.get_file_sizes(input_dataframe, result_dataframe)
json_object = json.dumps(json_dict, indent = 4)

json_object = json.dumps(json_dict, indent=4)
print("\nJSON Dictionary:\n", json_object)

# log results to console
with open('../cli/commands/current_session.txt', 'a') as f:
with open("../cli/commands/current_session.txt", "a") as f:
# write the print statements to a file
f.write(f"\n{json.dumps(input_dataframe)}\n")
f.write(f"\n{json.dumps(result_dataframe)}\n")
Expand All @@ -109,7 +109,6 @@ def track(self, input, result, meta):
f.write(f"\nTime taken: {time}\n")
f.write(f"\nNAN Count:\n {nan_count}\n")


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

Expand Down

0 comments on commit 77a626d

Please sign in to comment.