Skip to content

Commit

Permalink
Merge pull request yt-project#4885 from chrishavlin/tipsy_ascii_use_m…
Browse files Browse the repository at this point in the history
…ax_rows

ENH: tipsy use max_rows instead of skip_footer for ascii aux read
  • Loading branch information
chrishavlin committed Apr 26, 2024
2 parents 28a963e + 225ebcf commit 5dd2dff
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions yt/frontends/tipsy/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,11 @@ def _read_particle_data_file(self, data_file, ptf, selector=None):
)
)
else:
par = self.ds.parameters
nlines = 1 + par["nsph"] + par["ndark"] + par["nstar"]
aux_fh[afield].seek(0)
sh = aux_fields_offsets[afield][ptype]
sf = nlines - count - sh
if tp[ptype] > 0:
aux = np.genfromtxt(
aux_fh[afield], skip_header=sh, skip_footer=sf
aux_fh[afield], skip_header=sh, max_rows=count
)
if aux.ndim < 1:
aux = np.array([aux])
Expand Down

0 comments on commit 5dd2dff

Please sign in to comment.