Skip to main content
`Ctrl`+`K`

# def_physical_type

astropy.units.physical.def_physical_type(unit, name)

  Add a mapping between a unit and the corresponding physical type(s).

  If a physical type already exists for a unit, add new physical type names so long as those names are not already in use for other physical types.

  Parameters:
    unit `Unit`

      The unit to be represented by the physical type.

    name `str` or `set` of `str`

      A `str` representing the name of the physical type of the unit, or a `set` containing strings that represent one or more names of physical types.

  Raises:
    `ValueError`

      If a physical type name is already in use for another unit, or if attempting to name a unit as `"unknown"`.

  Notes

  For a list of physical types, see `astropy.units.physical`.