[yt-users] find_max error

Matthew Turk matthewturk at gmail.com
Tue Mar 6 08:10:04 PST 2012


Hi Stella,

On Tue, Mar 6, 2012 at 8:48 AM, Stella Offner <soffner at cfa.harvard.edu> wrote:
> Hi,
>
> I'm working with an undergrad student doing Orion data analysis using the
> most recent stable version of yt (he attended the recent yt workshop -
> yea!).

:-)

> However, he is encountering this error with his yt installation:
>
> File "slicePJ.py", line 18, in <module>
>    c = pf.h.find_max("Density") #this involves finding the max density
>  File "/usr/local/yt/yt-x86_64/src/yt-hg/yt/data_objects/static_output.py",
> line 172, in hierarchy
>    self, data_style=self.data_style)
>  File
> "/usr/local/yt/yt-x86_64/src/yt-hg/yt/frontends/orion/data_structures.py",
> line 131, in __init__
>    self._setup_field_list()
>  File
> "/usr/local/yt/yt-x86_64/src/yt-hg/yt/frontends/orion/data_structures.py",
> line 365, in _setup_field_list
>    for field in self.field_info:
>
> AttributeError: 'OrionHierarchy' object has no attribute 'field_info'
>
> I can't reproduce this error on any of my own yt installations with the data
> (although my versions are a bit older). His script (below) is pretty
> straight forward and successfully loads the data first. Any ideas?

Ah!  It turns out that in the field refactoring, I left in some calls
to outdated routines.  These aren't present in the unstable version,
but I was able to replicate the problem and push a fix to the stable
branch.  Updating to the latest stable changeset (8c971580c2d8) with
'yt update' should fix it right up.

Let me know if that helps out,

Matt

>
> from yt.mods import *
> from yt.funcs import *
> import particles
> import fields
> """
> The next section is taken from the yt cookbook as a basic test to make sure
> I can get everything to work
> """
> fn = "p1a09025"
> pf = load(fn)
> pf = load(fn) # load data
> pc = PlotCollection(pf) # defaults to center at most dense point
> pc.add_slice("Density", 0) # 0 = x-axis
> pc.add_slice("Density", 1) # 1 = y-axis
> pc.add_slice("Density", 2) # 2 = z-axis
> #pc.set_width(1.5, 'mpc') # change width of all plots in pc  #I have
> commented this line from the cookbook version
> pc.save(fn) # save all plots
> """
> Below are commented versions of older efforts, working off from what I did
> at the yt workshop
> """
> #dd = pf.h.all_data()
> #c = pf.h.find_max("Density") #this involves finding the max density
> #pc = PlotCollection(pf) #recentering  # commenented out the(  ,c ) in the
> argument to test if
> #p1 = pc.add_slice("Temperature", 2)
> #p2 = pc.add_projection("Density", 2, "Density")
> #pc.set_width(0.1, "unitary")
> #pc.set_cmap("cool")
>
> Thanks!
> Stella
>
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>



More information about the yt-users mailing list