From 306d13cc38ccddd7486592b6ccb467261071cb4a Mon Sep 17 00:00:00 2001 From: Sergey O Date: Thu, 20 Jul 2023 07:44:56 -0400 Subject: [PATCH] fix logging issue (if session was not restart between runs, log.txt was not recreated) --- AlphaFold2.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/AlphaFold2.ipynb b/AlphaFold2.ipynb index 114e42ab..4b3df70b 100644 --- a/AlphaFold2.ipynb +++ b/AlphaFold2.ipynb @@ -341,9 +341,10 @@ " plt.close()\n", "\n", "result_dir = jobname\n", - "if 'logging_setup' not in globals():\n", - " setup_logging(Path(os.path.join(jobname,\"log.txt\")))\n", - " logging_setup = True\n", + "log_filename = os.path.join(jobname,\"log.txt\")\n", + "if not os.path.isfile(log_filename) or 'logging_setup' not in globals():\n", + " setup_logging(Path(log_filename))\n", + " logging_setup = True\n", "\n", "queries, is_complex = get_queries(queries_path)\n", "model_type = set_model_type(is_complex, model_type)\n",