From 205e006874d1954ea4837aa28d9e1e4db817d75c Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Sun, 2 Jun 2024 01:10:33 +0100 Subject: [PATCH 1/2] f strings instead of addition --- jade/status.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/jade/status.py b/jade/status.py index 88e834f0..cc5c5c83 100644 --- a/jade/status.py +++ b/jade/status.py @@ -395,17 +395,7 @@ def check_override_run(self, lib: str, session: Session, exp: bool = False) -> b logtext = "\nThe following test results have been overwritten:" for code, test_runned in all_test_runned.items(): for test in test_runned: - logtext = ( - logtext - + "\n" - + "- " - + code - + ": " - + test - + " [" - + lib - + "]" - ) + logtext += f"\n- {code}: {test} [{lib}]" session.log.adjourn(logtext) return True From 45c0bbb42c07ec7e12f276d4cfa19b7ef097bca9 Mon Sep 17 00:00:00 2001 From: Jonathan Shimwell Date: Sun, 2 Jun 2024 01:22:44 +0100 Subject: [PATCH 2/2] a couple more f string convertions --- jade/utilitiesgui.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/jade/utilitiesgui.py b/jade/utilitiesgui.py index ed126a3b..718744ef 100644 --- a/jade/utilitiesgui.py +++ b/jade/utilitiesgui.py @@ -811,13 +811,7 @@ def print_XS_EXFOR(session): bookXS[j][MT] = bookXS[j]["dataT"].reactions[i] # Don't print if MT is not present in library except KeyError: - s = ( - "Channel MT" - + str(i) - + " " - + "not present in " - + bookXS[j]["name"] - ) + s = f"Channel MT{i} not present in {bookXS[j]['name']}" print(s) continue @@ -957,7 +951,7 @@ def print_XS_EXFOR(session): ) plt.savefig( os.path.join( - session.path_uti, isotope_name + "_" + MT + "_" + "XS" + ".png" + session.path_uti, f"{isotope_name}_{MT}_XS.png" ) ) print(" Cross Section printed")