Convert the quantity into the target unit.
- Parameters:
-
- unitUnit | None
The target unit, e.g. u.m, or None for the SI unit of the dimension.
- Returns:
-
- quantityQuantity
The quantity in the target unit.
- Raises:
-
- ValueError
If the target unit has another dimension or context.
- TypeError
If unit is neither a Unit nor None.