Skip to content

Commit

Permalink
Merge pull request #297 from shimwell/simple_refactors
Browse files Browse the repository at this point in the history
f strings instead of string addition for compact readable code
  • Loading branch information
dodu94 authored Jun 3, 2024
2 parents f563950 + 45c0bbb commit fe651d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
12 changes: 1 addition & 11 deletions jade/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 2 additions & 8 deletions jade/utilitiesgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")

0 comments on commit fe651d8

Please sign in to comment.