Skip to content

Commit f761a56

Browse files
committed
Deal with edge case
The columns are misaligned for 92Br in the 2016 table so the values are not parsed correctly. Fix manually.
1 parent 9bed08c commit f761a56

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/nuclearmasses/io/nubase_parse.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ def parse_half_life(self, raw_df) -> pd.DataFrame:
111111
mask = raw_df["HalfLifeValue"] == "stbl"
112112
raw_df.loc[mask, ["HalfLifeValue", "HalfLifeUnit", "HalfLifeError"]] = (99.99, "Zyr", 0.0)
113113

114+
if self.year == 2016:
115+
# the half-life related columns are misaligned for 92Br in 2016
116+
mask = (raw_df.A == 92) & (raw_df.Z == 35)
117+
raw_df.loc[mask, ["HalfLifeValue", "HalfLifeUnit", "HalfLifeError"]] = (0.314, "s", 0.016)
118+
114119
raw_df["HalfLifeValue"] = raw_df["HalfLifeValue"].astype("string").str.replace(r"[<>?~]", "", regex=True)
115120
# We'll be lazy here and remove any characters in this column. Future us will parse this properly
116121
raw_df["HalfLifeError"] = raw_df["HalfLifeError"].astype("string").str.replace(r"[<>?~a-z]", "", regex=True)

0 commit comments

Comments
 (0)