Description
In #11204 we made the physical_type attribute of units into instances of the new PhysicalType class. Before this, physical_type returned a string. It's now possible to do dimensional analysis along the lines of:
>>> import astropy.units as u
>>> length = u.m.physical_type
>>> area = u.get_physical_type("area")
>>> length * area
PhysicalType('volume')
There are descriptions on how to use physical types in the docstrings for PhysicalType, get_physical_type, and UnitBase.physical_type. Following a suggestion in #11204, it would be helpful to add a discussion of physical types in the narrative documentation for astropy.units.
It might be helpful to write out or have a table of all of the names of physical types. I'm not sure if this would be best in the narrative documentation or in the docstring for get_physical_type.
Description
In #11204 we made the
physical_typeattribute of units into instances of the newPhysicalTypeclass. Before this,physical_typereturned a string. It's now possible to do dimensional analysis along the lines of:There are descriptions on how to use physical types in the docstrings for
PhysicalType,get_physical_type, andUnitBase.physical_type. Following a suggestion in #11204, it would be helpful to add a discussion of physical types in the narrative documentation forastropy.units.It might be helpful to write out or have a table of all of the names of physical types. I'm not sure if this would be best in the narrative documentation or in the docstring for
get_physical_type.