<div dir="ltr"><div>Hi Yannick,</div><div><br></div>I'll let others answer your main question, but to answer the PS, there is a discussion of the performance hit to astropy.cosmology due to using Quantity here:<div><a href="https://github.com/astropy/astropy/issues/406">https://github.com/astropy/astropy/issues/406</a><br>
</div><div>Note however that Quantity has seen some optimization since this discussion, so the timings there probably aren't applicable any more.</div><div><br></div><div>- Kyle</div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Sun, Nov 24, 2013 at 5:50 PM, Yannick Roehlly <span dir="ltr"><<a href="mailto:yannick.roehlly@lam.fr" target="_blank">yannick.roehlly@lam.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all,<br>
<br>
I've encountered a problem with astropy 0.3 and I wonder how to solve<br>
it and if it's an astropy issue or not.<br>
<br>
I've got some code (a SED fitting code) that used to work with astropy<br>
0.2.5 and no longer works with version 0.3, failing with a "ValueError:<br>
setting an array element with a sequence." when trying to copy an array<br>
with numpy.copy.<br>
<br>
I managed to trace the problem. At some point, I'm using the cosmology<br>
module to compute a luminosity distance while building an array of<br>
fluxes. With astropy 0.3, the luminosity_distance functions returns<br>
quantities. So I have a "quantified" array that can not be copied with<br>
numpy.copy.<br>
<br>
So, I wonder if there is a way to disable this behaviour and make<br>
astropy not use quantities.<br>
<br>
Also, I wonder if this is not an astropy issue as it breaks working<br>
code (at least, there should be a warning in the changelog).<br>
<br>
Yannick<br>
<br>
PS: Does the use of quantities slows down the computation or their<br>
effect is negligible?<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Wernher von Braun settled for a V-2 when he coulda had a V-8.<br>
_______________________________________________<br>
AstroPy mailing list<br>
<a href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/astropy" target="_blank">http://mail.scipy.org/mailman/listinfo/astropy</a><br>
</font></span></blockquote></div><br></div>