One source of confusion may be the fact that both pf.parameters and pf.units, and perhaps others, are both accessible by just doing pf[some_variable].  In other words, you can do <br>pf['cm'] the same as pf.units['cm']<br>
and<br>pf['InitialTime'] the same as pf.parameters['InitialTime'].<br><br>I'm not sure this offers more convenience than it does confusion, so I would be in favor of getting rid of this feature.<br><br>
Britton<br><br><div class="gmail_quote">On Thu, Aug 18, 2011 at 11:21 AM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Dave,<br>
<br>
We can move this to yt-dev if we want to get into it more in depth,<br>
but the items that go into attributes right now are guaranteed to be:<br>
<br>
<a href="http://yt.enzotools.org/doc/advanced/developing.html#variable-names-and-enzo-isms" target="_blank">http://yt.enzotools.org/doc/advanced/developing.html#variable-names-and-enzo-isms</a><br>
<br>
All of these are necessary to perform fundamental actions in the code.<br>
 For instance, one does not necessarily need to know (in Enzo terms)<br>
the overdensity for refinement to conduct generic analysis.  However,<br>
one likely *does* need to know the domain left edge, the dimensions of<br>
the top grid, the dimensionality, etc.  It's not necessarily true that<br>
these are the correct parameters, but I think that one could make an<br>
argument for generic vs specific pieces of information about a<br>
simulation.  Generic should go into attributes, and should be<br>
guaranteed to exist.<br>
<br>
-Matt<br>
<br>
On Thu, Aug 18, 2011 at 11:03 AM, David Collins<br>
<div><div></div><div class="h5"><<a href="mailto:dcollins@physics.ucsd.edu">dcollins@physics.ucsd.edu</a>> wrote:<br>
> I'm for it in general.  The difference between "attributes" and<br>
> "parameters" is not obvious to me (rather, what things would be in<br>
> which category), but I'm not the fastest dog on the track.  I say go<br>
> for it.<br>
><br>
> d.<br>
><br>
> On Thu, Aug 18, 2011 at 8:16 AM, Britton Smith <<a href="mailto:brittonsmith@gmail.com">brittonsmith@gmail.com</a>> wrote:<br>
>> This sounds good to me.  Go ahead and add it as you described, I say.<br>
>><br>
>> On Thu, Aug 18, 2011 at 8:09 AM, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi all,<br>
>>><br>
>>> On Wed, Aug 17, 2011 at 5:59 PM, Britton Smith <<a href="mailto:brittonsmith@gmail.com">brittonsmith@gmail.com</a>><br>
>>> wrote:<br>
>>> > Hey Jeff,<br>
>>> ><br>
>>> > Are you getting this variable like this:<br>
>>> > pf.parameters['EOSCriticalDensity']<br>
>>> > or like this:<br>
>>> > pf.get_parameter('EOSCriticalDensity', float)<br>
>>> ><br>
>>> > If it's the first, then Dave is right that many of the pf parameters are<br>
>>> > not<br>
>>> > loaded by default, in which case you need to do the second way the first<br>
>>> > time.  After you've done that, you can refer to it with pf.parameters<br>
>>> > every<br>
>>> > time after that.<br>
>>><br>
>>> I had occasion last week to write a script to parse the Enzo parameter<br>
>>> file and interpret the values, guessing at their type.  (This was for<br>
>>> uploading Enzo simulation records to an IVOA database, which required<br>
>>> type-information about parameters.)  I think it might be a nice<br>
>>> addition, but I would like to propose that if it gets included, it not<br>
>>> be accessible via pf[every_parameter_in_enzo], simply because that<br>
>>> namespace is getting too crowded -- unit conversions, parameters, and<br>
>>> length conversions.<br>
>>><br>
>>> What if we included the parsing, and then for 3.0 (still a ways off)<br>
>>> we split into units, parameters, and attributes.  Attributes are<br>
>>> common between different output types -- domain_left_edge,<br>
>>> domain_right_edge, etc.  Then one could do:<br>
>>><br>
>>> pf.domain_right_edge<br>
>>> pf.units["mpc"]<br>
>>> pf.parameters["EOSCriticalDensity"]<br>
>>><br>
>>> Would that be alright?  For now we can just pollute the dict<br>
>>> namespace, but I don't particularly want this to be the permanent<br>
>>> solution.<br>
>>><br>
>>> -Matt<br>
>>><br>
>>> ><br>
>>> > Britton<br>
>>> ><br>
>>> > On Wed, Aug 17, 2011 at 5:55 PM, David Collins<br>
>>> > <<a href="mailto:dcollins@physics.ucsd.edu">dcollins@physics.ucsd.edu</a>><br>
>>> > wrote:<br>
>>> >><br>
>>> >> I think yt only knows about certain parameters initially, and for<br>
>>> >> others you need to tell it how to parse.  I have things like this in<br>
>>> >> my plugins file:<br>
>>> >><br>
>>> >> from yt.frontends.enzo.definitions import parameterDict<br>
>>> >> parameterDict['WhatDoesABoatDo'] = float<br>
>>> >><br>
>>> >> which then tells yt what type of variable 'WhatDoesABoatDo' should be<br>
>>> >> parsed as.<br>
>>> >><br>
>>> >> d.<br>
>>> >><br>
>>> >><br>
>>> >> On Wed, Aug 17, 2011 at 3:18 PM, j s oishi <<a href="mailto:jsoishi@gmail.com">jsoishi@gmail.com</a>> wrote:<br>
>>> >> > Hi all,<br>
>>> >> ><br>
>>> >> > I am trying to reach Enzo's EOSCriticalDensity parameter in my pf<br>
>>> >> > within yt (hg hash 486d7131f1c2) . For some reason, it throws a<br>
>>> >> > KeyError, even though grepping EOSCriticalDensity in the<br>
>>> >> > DD0001/data0001 file turns it right up:<br>
>>> >> ><br>
>>> >> > $ grep EOSCriticalDensity DD0001/data0001<br>
>>> >> > EOSCriticalDensity         = 1e-13<br>
>>> >> ><br>
>>> >> > I have deleted the .yt file, but to no avail. The error message is:<br>
>>> >> ><br>
>>> >> ><br>
>>> >> > In [1]: pf['EOSCriticalDensity']<br>
>>> >> ><br>
>>> >> ><br>
>>> >> > ---------------------------------------------------------------------------<br>
>>> >> > KeyError                                  Traceback (most recent call<br>
>>> >> > last)<br>
>>> >> ><br>
>>> >> ><br>
>>> >> > /home/jsoishi/build/yt-unknown/src/yt-hg/yt/utilities/command_line.pyc<br>
>>> >> > in <module>()<br>
>>> >> > ----> 1<br>
>>> >> >      2<br>
>>> >> >      3<br>
>>> >> >      4<br>
>>> >> >      5<br>
>>> >> ><br>
>>> >> ><br>
>>> >> ><br>
>>> >> > /home/jsoishi/build/yt-unknown/src/yt-hg/yt/data_objects/static_output.pyc<br>
>>> >> > in __getitem__(self, key)<br>
>>> >> >    118                   self.conversion_factors]:<br>
>>> >> >    119             if key in d: return d[key]<br>
>>> >> > --> 120         raise KeyError(key)<br>
>>> >> >    121<br>
>>> >> >    122     def keys(self):<br>
>>> >> ><br>
>>> >> > KeyError: 'EOSCriticalDensity'<br>
>>> >> ><br>
>>> >> > Can anyone provide insight? I feel fairly certain I'm doing something<br>
>>> >> > dumb, but I don't see what.<br>
>>> >> ><br>
>>> >> > thanks,<br>
>>> >> ><br>
>>> >> > jeff<br>
>>> >> > _______________________________________________<br>
>>> >> > yt-users mailing list<br>
>>> >> > <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>> >> > <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>> >> ><br>
>>> >><br>
>>> >><br>
>>> >><br>
>>> >> --<br>
>>> >> Sent from my computer.<br>
>>> >> _______________________________________________<br>
>>> >> yt-users mailing list<br>
>>> >> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>> >> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>> ><br>
>>> ><br>
>>> > _______________________________________________<br>
>>> > yt-users mailing list<br>
>>> > <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>> > <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>> ><br>
>>> ><br>
>>> _______________________________________________<br>
>>> yt-users mailing list<br>
>>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
>><br>
><br>
><br>
><br>
> --<br>
> Sent from my computer.<br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br>