radio-astro-tools / radio-beam

A simple toolkit for reading and manipulating beams from astrophysical radio spectral data cubes.
https://radio-beam.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
26 stars 20 forks source link

Small issues with Beam #127

Open mhvk opened 3 days ago

mhvk commented 3 days ago

As I was looking at the beam code for https://github.com/astropy/astropy/issues/17096, I noticed a few oddities in Beam. Mostly that it inherits from Quantity, which I'm not sure is a good idea given that some basic methods are overwritten and many others would not work (e.g., you'd need a proper __array_finalize__ to deal with slicing, etc.; right now, you'd lose the extra attributes with you do beam[()]). If there are real advantages to using Beam, I'd recommend using SpecificTypeQuantity.

A second thing I happened to notice is that default_unit is not actually used as described in the docstring.

Anyway, just flyby comments - hopefully of some use.

e-koch commented 2 days ago

Thanks @mhvk ! I opened #128 to fix the specific issue in https://github.com/astropy/astropy/issues/17096, and the default_unit description and usage.

agreed, we should look into switching to SpecificTypeQuantity. I don't think we otherwise have a specific need to inherit from Quantity