Hi,<div><br></div><div>Could we just check if 'm' exists in the columns dict, and not have a supp dict?</div><div><br></div><div>Sam<br><br><div class="gmail_quote">On Tue, Jul 10, 2012 at 10:18 AM, Stephen Skory <span dir="ltr"><<a href="mailto:s@skory.us" target="_blank">s@skory.us</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I didn't read my email until this morning, when I saw the text halos<br>
thread had exploded. I had no idea how strongly people felt about<br>
halos!<br>
<br>
Here is a proposal for a solution that I think reduces confusion and<br>
also adds capability. Using Christine's request as an example, what I<br>
would do is add to the LoadTextHaloes a supplementary data column<br>
dict:<br>
<br>
pf = load("data")<br>
halos = LoadTextHaloes(pf, "file.txt", columns = {'x':0, 'y':1, 'z':2,<br>
'r':3}, supp = {'m':4})<br>
<br>
And for each halo object there would be a supp dict hanging off of it:<br>
<br>
h0 = halos[0]<br>
h0.supp['m']<br>
<br>
This means that h0.total_mass() will correspond to the sphere, while<br>
the 'm' above to whatever's in the text file. This supp dict could be<br>
used to store temporary data for each halo object outside the<br>
LoadTextHaloes function, and if I hear that it might be useful, it<br>
could be included in a halo.dump() save.<br>
<br>
One issue is what happens to the supp columns? Do I float() them, or<br>
do I keep them strings, which allows users to convert them if needed?<br>
If I keep them strings, 'type' string columns would be useful. Or do I<br>
have yet another dict that specifies type in the call to<br>
LoadTextHaloes?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Stephen Skory<br>
<a href="mailto:s@skory.us">s@skory.us</a><br>
<a href="http://stephenskory.com/" target="_blank">http://stephenskory.com/</a><br>
<a href="tel:510.621.3687" value="+15106213687">510.621.3687</a> (google voice)<br>
_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
</font></span></blockquote></div><br></div>