[AstroPy] Problem with astropy 03 and quantities

Kyle Barbary kyle at anl.gov
Sun Nov 24 19:16:53 EST 2013


Hi Yannick,

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:
https://github.com/astropy/astropy/issues/406
Note however that Quantity has seen some optimization since this
discussion, so the timings there probably aren't applicable any more.

- Kyle


On Sun, Nov 24, 2013 at 5:50 PM, Yannick Roehlly <yannick.roehlly at lam.fr>wrote:

> Dear all,
>
> I've encountered a problem with astropy 0.3 and I wonder how to solve
> it and if it's an astropy issue or not.
>
> I've got some code (a SED fitting code) that used to work with astropy
> 0.2.5 and no longer works with version 0.3, failing with a "ValueError:
> setting an array element with a sequence." when trying to copy an array
> with numpy.copy.
>
> I managed to trace the problem. At some point, I'm using the cosmology
> module to compute a luminosity distance while building an array of
> fluxes. With astropy 0.3, the luminosity_distance functions returns
> quantities. So I have a "quantified" array that can not be copied with
> numpy.copy.
>
> So, I wonder if there is a way to disable this behaviour and make
> astropy not use quantities.
>
> Also, I wonder if this is not an astropy issue as it breaks working
> code (at least, there should be a warning in the changelog).
>
> Yannick
>
> PS: Does the use of quantities slows down the computation or their
> effect is negligible?
>
> --
> Wernher von Braun settled for a V-2 when he coulda had a V-8.
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20131124/14c9032a/attachment.html>


More information about the AstroPy mailing list