Skip to content

Commit

Permalink
fix: remove slash from f-str
Browse files Browse the repository at this point in the history
  • Loading branch information
CompRhys committed Jul 11, 2024
1 parent 121f519 commit 746078b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions aviary/wren/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ def backtrack(translation, index):
# Precompile regular expressions
re_wyckoff = re.compile(r"(?<!\d)([a-zA-Z])")
re_anonymous = re.compile(r"([A-Z])(?![0-9])")
re_insert_one = r"1\1"


def get_aflow_strs_from_iso_and_composition(
Expand Down Expand Up @@ -577,12 +578,12 @@ def get_aflow_strs_from_iso_and_composition(

translations = _find_translations(ele_amt_dict, anom_amt_dict)
anom_ele_to_wyk = dict(zip(anom_amt_dict.keys(), wyckoffs))
anonymous_formula = re_anonymous.sub(r"1\1", anonymous_formula)
anonymous_formula = re_anonymous.sub(re_insert_one, anonymous_formula)

return [
f"{proto_formula}_{pearson}_{spg}_"
f"{canonicalize_elem_wyks('_'.join(
re_wyckoff.sub(r'1\1', anom_ele_to_wyk[t[elem]])
re_wyckoff.sub(re_insert_one, anom_ele_to_wyk[t[elem]])
for elem in sorted(t.keys())
), spg)}:{'-'.join(sorted(t.keys()))}"
for t in translations
Expand Down

0 comments on commit 746078b

Please sign in to comment.