Skip to content

Commit 3036761

Browse files
committed
DEBUG: printing value of Npart
1 parent 6447dd4 commit 3036761

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

yt/frontends/rockstar/data_structures.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def __init__(self, ds, io, filename, file_id, range):
3939
f.seek(0, os.SEEK_END)
4040
self._file_size = f.tell()
4141

42+
# DEBUG: printing the values of _Npart
43+
for i, n in enumerate(self._Npart):
44+
print(f"halo {i} (id={self._ids_halos[i]}) has {n} particles")
45+
4246
expected_end = self._member_offset + 8 * self._Npart.sum()
4347
if expected_end != self._file_size:
4448
raise RuntimeError(
@@ -220,7 +224,7 @@ def __getitem__(self, key):
220224
@cached_property
221225
def ihalo(self):
222226
halo_id = self.particle_identifier
223-
halo_ids = list(self.halo_ds.r["halos", "particle_identifier"].astype(int))
227+
halo_ids = list(self.halo_ds.r["halos", "particle_identifier"].astype("i8"))
224228
ihalo = halo_ids.index(halo_id)
225229

226230
assert halo_ids[ihalo] == halo_id

0 commit comments

Comments
 (0)