[yt-users] Proposing changing the way parameter files get accessed

Matthew Turk matthewturk at gmail.com
Thu Sep 19 07:28:44 PDT 2013


Hi again,

Sorry for the quick reply.  But I just realized I showed what you
*couldn't* do, but not what you can.

The most common place this gets used is in something like:

sphere = pf.h.sphere( [0.1, 0.2, 0.3], 1.0/pf['mpc'])

to get a sphere centered at [0.1, 0.2, 0.3] that is a megaparsec in
radius.  You can *already* do this with:

sphere = pf.h.sphere( [0.1, 0.2, 0.3], (1.0, 'mpc'))

So this YTEP would simply change it so that this is the only way of
doing it, rather than relying on the dict-like access of the pf object
here.

-Matt

On Thu, Sep 19, 2013 at 10:22 AM, Matthew Turk <matthewturk at gmail.com> wrote:
> Hi all,
>
> Because yt is primarily exposed as a library on top of which scripts
> and analysis can be built, we have recently (wow, actually, it's been
> almost a year!) attempted to start a mechanism of proposing,
> discussing and then finally implementing changes that touch the API.
> (YTEPs, or "yt Enhancement Proposals.")
>
> Because this particular change would be quite wide-ranging, I wanted
> to bring it up before it got much further in the discussion.
>
> https://bitbucket.org/yt_analysis/ytep/pull-request/24/ytep-0018-reducing-dict-like-access-to/
>
> Essentially, what this would do is eliminate this operation:
>
> 1.0/pf["cm"]
>
> or
>
> 128.0/pf["mpc"]
>
> to specify length units.  Any accessing of a parameter file (static
> output, dataset, whatever) like a dictionary would be changed.  The
> initial implementation of the YTEP suggests that this be limited to
> just allowing parameters (i.e., this would be things that the
> simulation frontend identifies as controlling the simulation) but not
> units, conversion factors, etc etc, to be accessed this way.  But,
> there have been discussions in the pull request about making it so
> that a "pf" cannot be accessed like a dictionary at all.
>
> This would exclusively change in yt 3.0, and would not propagate to
> the current releases.  However, since we're hoping to shift
> development over to 3.0 not too long from now, I think getting input
> on this possible change would be extremely valuable.
>
> So if you're interested, head on over to the YTEP and share your
> feelings.  This would likely break a lot of scripts, but it's also a
> ways off, and you can always stick with the current version of yt
> you're using.
>
> Thanks,
>
> Matt



More information about the yt-users mailing list