diff --git a/src/rimsschemedrawer/gui.py b/src/rimsschemedrawer/gui.py index 74dfe8b..c0eb0f3 100644 --- a/src/rimsschemedrawer/gui.py +++ b/src/rimsschemedrawer/gui.py @@ -873,9 +873,9 @@ def write_json(self) -> dict: dispforbidden = "noshow" savedict["settings"]["show_forbidden_transitions"] = dispforbidden savedict["settings"]["plot_title"] = self.edt_sett_plttitle.text() - savedict["settings"][ - "show_transition_strength" - ] = self.chk_sett_trans_strength.isChecked() + savedict["settings"]["show_transition_strength"] = ( + self.chk_sett_trans_strength.isChecked() + ) savedict["settings"]["line_breaks"] = self.chk_sett_linebreaks.isChecked() savedict["settings"]["show_cm-1_axis"] = self.chk_sett_showcmax.isChecked() savedict["settings"]["show_eV_axis"] = self.chk_sett_showevax.isChecked() diff --git a/tests/test_utils.py b/tests/test_utils.py index 65949c0..b3eef29 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -87,6 +87,13 @@ def test_term_to_string(vals): assert ut.term_to_string(vals[0]) == vals[1] +def test_term_to_string_latex(): + """Return a string surrounded by $ if LaTeX characters found.""" + str_in = "^{3}F_{2}" + str_exp = f"${str_in}$" + assert ut.term_to_string(str_in) == str_exp + + @pytest.mark.parametrize("val", ["IP", "AI", "Rydberg", "Ryd"]) def test_term_to_string_no_change(val): """Leave these symbols / strings unchanged."""