[yt-dev] Region object API change

Cameron Hummels chummels at gmail.com
Fri Jul 25 18:40:05 PDT 2014


As I'm writing up the objects documentation, I realize that we have some
weirdness with our "region" object in that we require it to have a
specified center, even though the only things which are really needed to
specify a 3D box are the left corner and right corner.  I know in the past
I've been perplexed by this additional center point requirement, and it
might confuse others.  Since 3.0 is the time to break API, how do people
feel about changing the constructor for the region object to just be:

region(left corner, right corner)

instead of the current constructor:

region(center, left corner, right corner)

?

I realize that this is right before the release, but it seems like if we're
going to change it, now is the time to do it.  In fact, I was looking at
ways to overload the region class with a wrapper so that we could just
automatically accept 2 arguments and calculate the average of the left and
right corners to pass to the 3-argument constructor.  But I couldn't seem
to find a way to make this work.

+/-1 on changing the region constructor?

Cameron

-- 
Cameron Hummels
Postdoctoral Researcher
Steward Observatory
University of Arizona
http://chummels.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20140725/fe210a10/attachment.htm>


More information about the yt-dev mailing list