<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">I’m wondering why a new astropy.units.Quantity doesn’t own its own data, even when I specify copy=True when creating it:</div><div class=""><br class=""></div><div class="">>>> from astropy.units import Quantity</div><div class="">>>> a = Quantity([1, 2, 3], copy=True)</div><div class="">>>> print(a.flags.owndata)</div><div class="">False</div><div class=""><br class=""></div><div class="">I know technically how that is true, since there is a view() call in the __new__ constructor, but not why is was implemented in this way. There are lines in other parts of quantity.py that reference this fact, which makes it seem like this was a conscious decision, rather than an accident.</div><div class=""><br class=""></div><div class="">Can someone explain the thinking behind this decision?</div><div class=""><br class=""></div><div class="">I realise I can use Quantity([1, 2, 3]).copy() to create a clean copy that does own the data, but that seems a little inelegant.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Duncan</div><div class=""><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">--</div><div class="">Duncan Macleod</div><div class=""><a href="mailto:duncan.macleod@ligo.org" class="">duncan.macleod@ligo.org</a></div><div class=""><div class="">LIGO Data Grid systems development</div><div class="">Louisiana State University</div></div></div>

</div>
<br class=""></div></body></html>