Skip to content

Commit

Permalink
Fix bug in Moore labelling of atomic states
Browse files Browse the repository at this point in the history
  • Loading branch information
xnx committed Aug 16, 2023
1 parent 339c1d9 commit b09fb67
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -8,7 +8,7 @@

setup(
name="pyvalem",
version="2.5.14",
version="2.5.15",
description="A package for managing simple chemical species and states",
long_description=long_description,
long_description_content_type="text/x-rst",
Expand Down
6 changes: 3 additions & 3 deletions src/pyvalem/states/atomic_term_symbol.py
Expand Up @@ -47,7 +47,7 @@ def __init__(self, state_str):
self.L = None
self.parity = None
self.J = None
self.moore_letter = ""
self.moore_label = ""
self._parse_state(state_str)

def _parse_state(self, state_str):
Expand Down Expand Up @@ -87,7 +87,7 @@ def _validate_j(self):
def html(self):
html_chunks = [
"{0}<sup>{1:d}</sup>{2:s}".format(
self.moore_letter, self.Smult, self.Lletter
self.moore_label, self.Smult, self.Lletter
)
]
if self.parity:
Expand All @@ -101,7 +101,7 @@ def html(self):
def latex(self):
latex_chunks = [
r"{}{{}}^{{{}}}\mathrm{{{}}}".format(
self.moore_letter, self.Smult, self.Lletter
self.moore_label, self.Smult, self.Lletter
)
]
if self.parity:
Expand Down
3 changes: 3 additions & 0 deletions tests/test_atomic_term_symbols.py
Expand Up @@ -60,6 +60,9 @@ def test_moore_label(self):
self.assertEqual(a1.moore_label, "z")
self.assertEqual(a2.moore_label, "")
self.assertEqual(a3.moore_label, "e")
self.assertEqual(a0.html, "a<sup>5</sup>D")
self.assertEqual(a0.latex, r"a{}^{5}\mathrm{D}")
self.assertEqual(a1.latex, r"z{}^{3}\mathrm{P}^o")
self.assertRaises(AtomicTermSymbolError, AtomicTermSymbol, "A5D")


Expand Down

0 comments on commit b09fb67

Please sign in to comment.