AttributeError: объект 'DatasetSeries' не имеет атрибута 'all_data' - PullRequest
0 голосов
/ 13 июля 2020
import glob
from os.path import join
import yt
from yt.config import ytcfg
path = ytcfg.get("yt", "test_data_dir")

from mpl_toolkits.mplot3d import Axes3D
my_fns = glob.glob(join(path, "Orbit", "puredef_hdf5_chk_000000"))
my_fns.sort()
fields = ["particle_velocity_x", "particle_velocity_y", "particle_velocity_z"]
ds = yt.load(my_fns[:])
dd = ds.all_data()
indices = dd["particle_index"].astype("int")
print (indices)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-27-1bae40a7b7ba> in <module>
      1 ds = yt.load(my_fns[:])
----> 2 dd = ds.all_data()
      3 indices = dd["particle_index"].astype("int")
      4 print (indices)

AttributeError: 'DatasetSeries' object has no attribute 'all_data'

Я просмотрел другие сообщения здесь, но многие из них касаются различных аспектов этой ошибки, связанной с линзами или другими утверждениями.

...