Skip to content

Commit

Permalink
Fixes some deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewfullard committed Sep 9, 2024
1 parent 273654a commit 86a2a42
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion carsus/io/chianti_/chianti_.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def versionRead():
masterlist_ions = pickle.load(masterlist_ions_file).keys()
# Exclude the "d" ions for now
masterlist_ions = [_ for _ in masterlist_ions
if re.match("^[a-z]+_\d+$", _)]
if re.match(r"^[a-z]+_\d+$", _)]

masterlist_version = versionRead()

Expand Down
8 changes: 4 additions & 4 deletions carsus/io/cmfgen/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def load(self, fname):
config = {
"header": None,
"index_col": False,
"sep": "\s+",
"sep": r"\s+",
"skiprows": skiprows,
"nrows": nrows,
"engine": "python",
Expand Down Expand Up @@ -112,7 +112,7 @@ def load(self, fname):
config = {
"header": None,
"index_col": False,
"sep": "\s*\|\s*|-?\s+-?\s*|(?<=[^ED\s])-(?=[^\s])",
"sep": r"\s*\|\s*|-?\s+-?\s*|(?<=[^ED\s])-(?=[^\s])",
"skiprows": skiprows,
"nrows": nrows,
"engine": "python",
Expand Down Expand Up @@ -177,7 +177,7 @@ class CMFGENCollisionalStrengthsParser(BaseParser):

def load(self, fname):
header = parse_header(fname)
skiprows, _ = find_row(fname, "ransition\T")
skiprows, _ = find_row(fname, r"ransition\T")
config = {
"header": None,
"index_col": False,
Expand All @@ -194,7 +194,7 @@ def load(self, fname):
config["nrows"] = end - config["skiprows"] - 2

try:
_, columns = find_row(fname, "ransition\T")
_, columns = find_row(fname, r"ransition\T")
columns = columns.split()

# NOTE: Comment next line when trying new regexes
Expand Down
4 changes: 2 additions & 2 deletions carsus/io/kurucz/gfall.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ def parse_gfall(self, gfall_raw=None):
gfall["label_lower"] = gfall["label_lower"].str.strip()
gfall["label_upper"] = gfall["label_upper"].str.strip()

gfall["label_lower"] = gfall["label_lower"].str.replace("\s+", " ")
gfall["label_upper"] = gfall["label_upper"].str.replace("\s+", " ")
gfall["label_lower"] = gfall["label_lower"].str.replace(r"\s+", " ")
gfall["label_upper"] = gfall["label_upper"].str.replace(r"\s+", " ")

# Ignore lines with the labels "AVARAGE ENERGIES" and "CONTINUUM"
ignored_labels = ["AVERAGE", "ENERGIES", "CONTINUUM"]
Expand Down
2 changes: 1 addition & 1 deletion carsus/io/output/collisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def prepare_collisions(self):
collisions_index
+ ["g_ratio", "delta_e"]
+ sorted(
[col for col in self.collisions.columns if re.match("^t\d+$", col)]
[col for col in self.collisions.columns if re.match(r"^t\d+$", col)]
)
)

Expand Down
2 changes: 1 addition & 1 deletion carsus/io/zeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _prepare_data(self):
usecols=range(1, 23),
names=names,
comment="#",
delim_whitespace=True)
sep=r"\s+")

self.base = (
pd.DataFrame(zeta_df).set_index(
Expand Down

0 comments on commit 86a2a42

Please sign in to comment.