Skip to content

Commit

Permalink
Merge pull request #422 from tardis-sn/fix_C2_bug_in_molecules
Browse files Browse the repository at this point in the history
fix missing C2 in vald
  • Loading branch information
jvshields authored Nov 13, 2024
2 parents 977c921 + c39c8b4 commit 487efcd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion carsus/io/tests/test_vald.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_vald_short_stellar_linelist_molecules(
v_mic,
ion_charge,
):
assert len(vald_linelist_molecules_short_form_stellar) == 94
assert len(vald_linelist_molecules_short_form_stellar) == 95
row = vald_linelist_molecules_short_form_stellar.iloc[index]
assert_almost_equal(row["wavelength"], wavelength)
assert_allclose(
Expand Down
4 changes: 3 additions & 1 deletion carsus/io/vald/vald.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ def read_vald_raw(self, fname=None):
# Elm Ion WL_air(A) log gf* E_low(eV) J lo E_up(eV) J up lower upper mean Rad. Stark Waals
# 'TiO 1', 4100.00020, -11.472, 0.2011, 31.0, 3.2242, 32.0, 99.000, 99.000, 99.000, 6.962, 0.000, 0.000,

DATA_RE_PATTERN = re.compile("'[a-zA-Z]+ \d+',[\s*-?\d+[\.\d+]+,]*")
DATA_RE_PATTERN = re.compile(
r"'[a-zA-Z]+\d* \d+',[\s*-?\d+[\.\d+]+,]*"
) # This matches to the Elm Ion field of the format above (e.g., TiO 1 or C 2)

buffer, checksum = read_from_buffer(self.fname)
content = buffer.read().decode()
Expand Down

0 comments on commit 487efcd

Please sign in to comment.