Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use sep for pd.read_csv #198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion isochrones/bc.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def parse_table(self, filename):
names = line[1:].split()
break
return pd.read_csv(
filename, names=names, delim_whitespace=True, comment="#", index_col=self.index_cols
filename, names=names, sep=r"\s+", comment="#", index_col=self.index_cols
)

def get_table(self, phot, feh):
Expand Down
4 changes: 2 additions & 2 deletions isochrones/mist/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def to_df(cls, filename):
break
feh = cls.get_feh(filename)
df = pd.read_csv(
filename, comment="#", delim_whitespace=True, skip_blank_lines=True, names=column_names
filename, comment="#", sep=r"\s+", skip_blank_lines=True, names=column_names
)
df["feh"] = feh
return df
Expand Down Expand Up @@ -275,7 +275,7 @@ def to_df(cls, filename):
break
initial_mass = cls.get_mass(filename)
df = pd.read_csv(
filename, comment="#", delim_whitespace=True, skip_blank_lines=True, names=column_names
filename, comment="#", sep=r"\s+", skip_blank_lines=True, names=column_names
)
df["initial_mass"] = initial_mass
try:
Expand Down
2 changes: 1 addition & 1 deletion isochrones/starmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1653,7 +1653,7 @@ def derived_samples(self):
def _make_samples(self):
filename = "{}post_equal_weights.dat".format(self.mnest_basename)
try:
df = pd.read_csv(filename, names=self.param_names + ("lnprob",), delim_whitespace=True)
df = pd.read_csv(filename, names=self.param_names + ("lnprob",), sep=r"\s+")
except OSError:
logger.error("Error loading chains from {}".format(filename))
raise
Expand Down