def METHOD_NAME(self, sub_file, needed_ptype=None):
    si, ei = sub_file.start, sub_file.end
    f = h5py.File(sub_file.filename, mode="r")
    pcount = f["/Header"].attrs["NumPart_ThisFile"][:].astype("int")
    np.clip(pcount - si, 0, ei - si, out=pcount)
    pcount = pcount.sum()
    for key in f.keys():
        if (
            not key.startswith("PartType")
            or "Coordinates" not in f[key]
            or needed_ptype
            and key != needed_ptype
        ):
            continue
        pos = f[key]["Coordinates"][si:ei, ...]
        pos = pos.astype("float64", copy=False)
        yield key, pos
    f.close()