diff --git a/ersilia/cli/commands/close.py b/ersilia/cli/commands/close.py index 625d1fefa..d053ceda4 100644 --- a/ersilia/cli/commands/close.py +++ b/ersilia/cli/commands/close.py @@ -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) \ No newline at end of file + 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) diff --git a/ersilia/cli/commands/serve.py b/ersilia/cli/commands/serve.py index c8b4be6ce..d4018357a 100644 --- a/ersilia/cli/commands/serve.py +++ b/ersilia/cli/commands/serve.py @@ -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: diff --git a/ersilia/core/tracking.py b/ersilia/core/tracking.py index ec7c0c9be..e759e5400 100644 --- a/ersilia/core/tracking.py +++ b/ersilia/core/tracking.py @@ -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") @@ -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")