<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; "><div>Hi Jim,</div><div><br></div><div>Thank you very much for the sample code for data types. This is perfect (and powerful) and should allow us to support all of the data types we'll need (including any "custom" ones).</div><div><br></div><div>Best,</div><div>Chris</div><div><br></div><span id="OLK_SRC_BODY_SECTION"><div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt"><span style="font-weight:bold">From: </span> James Porter <<a href="mailto:jvporter@wisc.edu">jvporter@wisc.edu</a>><br><span style="font-weight:bold">Date: </span> Mon, 13 Feb 2012 15:46:06 -0500<br><span style="font-weight:bold">To: </span> Christopher Mueller <<a href="mailto:cmueller@asascience.com">cmueller@asascience.com</a>><br><span style="font-weight:bold">Cc: </span> "<a href="mailto:moab-dev@mcs.anl.gov">moab-dev@mcs.anl.gov</a>" <<a href="mailto:moab-dev@mcs.anl.gov">moab-dev@mcs.anl.gov</a>>, Guy De Wardener <<a href="mailto:gdewardener@asascience.com">gdewardener@asascience.com</a>>, David Stuebe <<a href="mailto:DStuebe@asascience.com">DStuebe@asascience.com</a>>, "<a href="mailto:don.brittain@instanteffects.com">don.brittain@instanteffects.com</a>" <<a href="mailto:don.brittain@instanteffects.com">don.brittain@instanteffects.com</a>><br><span style="font-weight:bold">Subject: </span> Re: [MOAB-dev] Questions about Tags and Topology<br></div><div><br></div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div><div><div>On Fri, 2012-02-10 at 17:28 -0500, Christopher Mueller wrote:</div><blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="BORDER-LEFT: #b5c4df 5 solid; PADDING:0 0 0 5; MARGIN:0 0 0 5;"><div> Hi Tim,</div><div> </div><div> </div><div> I've had a good deal of success this week and have been able to</div><div> represent a couple of our simpler datasets in what seems to be a</div><div> reasonable manner. I have also come up with a few questions. </div><div> </div><div> </div><div> Tags:</div><div> * DataTypes – from what I can see, tags do not support a few of</div><div> the numpy datatypes, namely: float32, int16, and int64. Is</div><div> this a constraint of the PyTAPS wrapper or the underlying</div><div> iMesh/MOAB infrastructure?</div></blockquote><div><br></div><div>iMesh only supports a handful of types, but as mentioned, the bytes type</div><div>lets you convert to/from the type you actually want. Here are some</div><div>sample functions to do this:</div><div><br></div><div>def set_packed(tag, key, value):</div><div> tag[key] = numpy.frombuffer(numpy.asarray(value), dtype=numpy.byte)</div><div><br></div><div>def get_packed(tag, key, dtype):</div><div> return numpy.frombuffer(tag[key], dtype=dtype)</div><div><br></div><div># In use:</div><div>set_packed(my_tag, my_entity, numpy.int16(300))</div><div>get_packed(my_tag, my_entity, numpy.int16)</div><div><br></div><div>- Jim</div><div><br></div><div><br></div></div></div></blockquote></span></body></html>