DataInfo¶
- class astropy.utils.data_info.DataInfo(bound=False)[source]¶
Bases:
objectDescriptor that data classes use to add an
infoattribute for storing data attributes in a uniform and portable way. Note that it must be calledinfoso that the DataInfo() object can be stored in theinstanceusing theinfokey. 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.