[yt-users] how to call HaloMassFcn

Matthew Turk matthewturk at gmail.com
Wed Sep 8 22:39:29 PDT 2010


Hi Geoffrey,

As I mentioned earlier, the version installed on Triton is from before
the reorganization.  Use the yt documentation to get the imports
correctly, and debug the imports on a single core -- you can run the
imports just interactively on the login node.  You don't need the
analysis_modules stuff.  :)

This worked for me:

from yt.mods import *
from yt.extensions.halo_mass_function import *

taken from here:

http://yt.enzotools.org/doc/howto/hmf_howto.html

-Matt

On Wed, Sep 8, 2010 at 10:37 PM,  <gso at physics.ucsd.edu> wrote:
> I had to cut and paste some of the errors because I used 64 cores, but I
> think here's all of them:
>
> /projects/lca-group/local-dev/lib/python2.6/site-packages/pytz/__init__.py:29:
> UserWarning: Module readline was already imported from
> /projects/lca-group/lo$
>  from pkg_resources import resource_stream
> Traceback (most recent call last):
>  File "parallelHF.py", line 3, in <module>
>    from yt.analysis_modules.halo_mass_function.api import *
> ImportError: No module named analysis_modules.halo_mass_function.api
>
> this is with Mike's
> from yt.analysis_modules.halo_mass_function.api import *
> looks like it can't find the corresponding module.
>
> Am I the only one seeing this on triton?  Just curious, might be something
> wrong with my env variable etc?
>
> From
> G.S.
>
>
>
>> Hi Mike and Geoffrey,
>>
>> To help alleviate with this, I've added a new list (which is created
>> at runtime, but can be re-created) called "available_analysis_modules"
>> to yt.mods.  So right now it looks like this:
>>
>>>>> from yt.mods import *
>>>>> available_analysis_modules
>>
>> ['coordinate_transformation', 'halo_finding', 'halo_mass_function',
>> 'halo_merger_tree', 'halo_profiler', 'hierarchy_subset', 'level_sets',
>> 'light_cone', 'light_ray', 'simulation_handler',
>> 'spectral_integrator', 'star_analysis', 'two_point_functions']
>>
>> So you can then import from any of the api's in those directories.
>> This just uses a very simple guess at where the directory
>> analysis_modules is located, and won't support things like extensions
>> in external packages etc etc.  But it should get us most of the way
>> there...
>>
>> -Matt
>>
>> On Wed, Sep 8, 2010 at 7:06 PM, Michael Kuhlen <mqk at astro.berkeley.edu>
>> wrote:
>>>
>>> I ran into the same problem today. The following works for me:
>>>
>>> from yt.mods import *
>>> from yt.analysis_modules.halo_mass_function.api import *
>>>
>>> I figured this out by looking in $YTDIR/yt/analysis_modules/.
>>>
>>> Mike
>>>
>>>
>>> gso at physics.ucsd.edu wrote:
>>>>
>>>> I'm getting this error on an old script I used to create the halo mass
>>>> function on Triton
>>>>
>>>> I had on top
>>>> from yt.analysis_modules.halo_finding.api import HaloMassFcn
>>>>
>>>> and got:
>>>>
>>>> Traceback (most recent call last):
>>>>  File "parallelHF.py", line 52, in <module>
>>>>    hmf = HaloMassFcn(pf,
>>>> halo_file=filename[3]+"ParallelHopAnalysis.out",
>>>> NameError: name 'HaloMassFcn' is not defined
>>>>
>>>> I was wondering if this is because yt was updated to 2.0 on triton?
>>>> in the email there's an example of what to use for HaloFinder
>>>>
>>>> from yt.analysis_modules.halo_finding.api import HaloFinder
>>>>
>>>> so for HaloMassFcn do I do
>>>>
>>>> from yt.analysis_modules.halo_????.api import HaloMassFcn
>>>>
>>>> can someone fill in what ???? is, or how I can find that information?
>>>>  Or
>>>> is the 2.0 manual out that I'm not aware of that has this information
>>>> already?
>>>>
>>>> From
>>>> G.S.
>>>>
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users at lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>> --
>>> *********************************************************************
>>> *                                                                   *
>>> *  Dr. Michael Kuhlen              Theoretical Astrophysics Center  *
>>> *  email: mqk at astro.berkeley.edu   UC Berkeley                      *
>>> *  cell phone: (831) 588-1468      601 Campbell Hall                *
>>> *  skype username: mikekuhlen      Berkeley, CA 94720               *
>>> *                                                                   *
>>> *********************************************************************
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>
>
> _______________________________________________
> 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