[yt-users] error

Cynthia Saad (Student) crs07 at mail.aub.edu
Sun Jul 16 01:17:23 PDT 2017


dear all

i am using yt for enzo. my script reads:


import yt

# Load the dataset.
ds = yt.load("~/enzo/run/CosmologySimulation/AMRCosmology/DD0001/DD0001")

# Create a 1 Mpc radius sphere, centered on the max density.
sp = ds.sphere("max", (0.1, "Mpc"))

# Use the total_quantity derived quantity to sum up the
# values of the cell_mass and particle_mass fields
# within the sphere.
baryon_mass, particle_mass = sp.quantities.total_quantity(["cell_mass", "particle_mass"])

print("Total mass in sphere is %0.3e Msun (gas = %0.3e Msun, particles = %0.3e Msun)" % \
      ((baryon_mass + particle_mass).in_units('Msun'), \
       baryon_mass.in_units('Msun'), particle_mass.in_units('Msun')))

-----------

the error i am getting is:

~/enzo/run/CosmologySimulation/AMRCosmology$ python trial.py
Traceback (most recent call last):
  File "trial.py", line 4, in <module>
    ds = yt.load("~/enzo/run/CosmologySimulation/AMRCosmology/DD0001/DD0001")
  File "/usr/local/lib/python2.7/dist-packages/yt/convenience.py", line 79, in load
    if c._is_valid(*args, **kwargs): candidates.append(n)
  File "/usr/local/lib/python2.7/dist-packages/yt/frontends/flash/data_structures.py", line 493, in _is_valid
    fileh = HDF5FileHandler(args[0])
  File "/usr/local/lib/python2.7/dist-packages/yt/utilities/file_handler.py", line 22, in __init__
    self.handle = h5py.File(filename, 'r')
  File "/usr/local/lib/python2.7/dist-packages/yt/utilities/on_demand_imports.py", line 31, in __call__
    raise self.error
ImportError: This functionality requires the h5py package to be installed.

----------------


is my script outdated, there is something wrong with my installation or deficiencies in the python libraries?


thank you

cynthia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170716/d9e55976/attachment.htm>


More information about the yt-users mailing list