forked from astropy/astropy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request astropy#16676 from eerovaher/units-format_exponent…
…ial_notation Shuffle unit formatter `format_exponential_notation()` methods
- Loading branch information
Showing
6 changed files
with
45 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
The ``format_exponential_notation()`` method of the ``Base`` unit formatter has | ||
changed. | ||
Any unit formatters that inherit directly from ``Base`` but have not | ||
implemented their own ``format_exponential_notation()`` and wish to retain | ||
previous behavior should implement it as: | ||
|
||
.. code-block:: python | ||
def format_exponential_notation(cls, val, format_spec): | ||
return format(val, format_spec) | ||
Any formatters that inherit directly from ``Base`` and call | ||
``super().format_exponential_notation(val, format_spec)`` should instead call | ||
``format(val, format_spec)`` | ||
The specific unit formatters in ``astropy.units`` and custom formatters that | ||
inherit from any of them are not affected. |