diff --git a/fiasco/levels.py b/fiasco/levels.py index 5250f868..cd6acf20 100644 --- a/fiasco/levels.py +++ b/fiasco/levels.py @@ -100,10 +100,11 @@ def label(self): Label denoting level configuration, multiplicity, angular momentum label, and total angular momentum. """ - zipped = zip(self.configuration, - self.multiplicity, - self.orbital_angular_momentum_label, - self.total_angular_momentum) + zipped = zip(np.atleast_1d(self.configuration), + np.atleast_1d(self.multiplicity), + np.atleast_1d(self.orbital_angular_momentum_label), + np.atleast_1d(self.total_angular_momentum), + ) return np.array([f"{i} {j}{k}{Fraction(l.value)}" for i,j,k,l in zipped]) @property diff --git a/fiasco/tests/test_ion.py b/fiasco/tests/test_ion.py index 32ddb902..f585a687 100644 --- a/fiasco/tests/test_ion.py +++ b/fiasco/tests/test_ion.py @@ -100,6 +100,8 @@ def test_level(ion): assert level.orbital_angular_momentum_label == 'D' assert level.orbital_angular_momentum == 2 assert level.is_observed + assert len(level.label) == 1 + assert level.label[0] == '3d4 5D0' @pytest.mark.parametrize(('ion_name', 'n_levels'), [