Skip to content
Merged
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
8 changes: 5 additions & 3 deletions yt/frontends/ramses/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ def _ramses_particle_csv_file_handler(particle_handler, subset, fields, count):
# read only selected fields
dat = pd.read_csv(
fname,
delimiter=",",
delimiter=r"\s*,\s*",
engine="python",
usecols=[ind for _field, ind in list_field_ind],
skiprows=2,
header=None,
Expand Down Expand Up @@ -360,7 +361,7 @@ def _read_part_csv_file_descriptor(fname: Union[str, "os.PathLike[str]"]):

# Fields name from the default csv RAMSES sink algorithm in the yt default convention
mapping = {
" # id": "particle_identifier",
"# id": "particle_identifier",
"msink": "particle_mass",
"x": "particle_position_x",
"y": "particle_position_y",
Expand All @@ -386,11 +387,12 @@ def _read_part_csv_file_descriptor(fname: Union[str, "os.PathLike[str]"]):
}

# read the all file to get the number of particle
dat = pd.read_csv(fname, delimiter=",")
dat = pd.read_csv(fname, delimiter=r"\s*,\s*", engine="python")
fields = []
local_particle_count = len(dat)

for varname in dat.columns:
varname = varname.strip()
if varname in mapping:
varname = mapping[varname]
else:
Expand Down
Loading