DataInfo¶
- class astropy.utils.data_info.DataInfo(bound=False)[source]¶
Bases:
object
Descriptor that data classes use to add an
info
attribute for storing data attributes in a uniform and portable way. Note that it must be calledinfo
so that the DataInfo() object can be stored in theinstance
using theinfo
key. Because owner_cls.x is a descriptor, Python doesn’t use __dict__[‘x’] normally, and the descriptor can safely store stuff there. Thanks to https://nbviewer.jupyter.org/urls/gist.github.com/ChrisBeaumont/5758381/raw/descriptor_writeup.ipynb for this trick that works for non-hashable classes.- Parameters:
- boundbool
If True this is a descriptor attribute in a class definition, else it is a DataInfo() object that is bound to a data object instance. Default is False.