Open taldcroft opened 4 years ago
Probably good to restate my general worry, which is that whether or not set values propagate back to parents will become rather random. E.g.,
sc1 = SkyCoord([1, 0, 1]*u.deg, [2, 3, 4]*u.deg, obstime='J2001')
sc2 = sc1[:2]
sc2[0] = SkyCoord(0*u.deg, 0.*.deg, obstime='J2010')
will, with the current implementation of __getitem__
, change the coordinates in sc1[0]
as well, but it will not change obstime
(since that is a scalar, and by setting one element in sc2
, sc2.obstime
will have to be turned into an array). I fear this will lead to very hard to debug problems.
That said, I think in principle it is OK if obstime
is already an array in the first place.
Also, I think there is no problem when copies of everything are being made anyway. In fact, there is no reason not to have the general np.stack
and np.concatenate
work with SkyCoord
(using __array_ufunc__
- #8610) - all those can work, I think, via SkyCoordInfo.new_like
).
Description
Currently the
__setitem__
support forBaseFrame
andSkyCoord
require that frame attributes are exactly the same in the object being updated and the right hand side value. Some WIP code that would help in making things somewhat more flexible is shown below and was removed from #9857 in 8b161db70. See also https://github.com/astropy/astropy/pull/9857#pullrequestreview-385950530.For instance there is no reason that one should not be able to do:
Additional context