forked from astropy/astropy
-
Notifications
You must be signed in to change notification settings - Fork 1
Implement units, adjust tests and documentation #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or 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
get_format could fail in weird ways because it would check if 'get_format' was a valid format.
This fix simply ignores the last two entries in the ``__all__`` list ('get_format', and the just added 'has_format')
to prevent this issue. An alternative solution could be to use introspection.
has_format returns a boolean as to whether the passed in format would work or not.
The format method can accept a format specifier name, and calls that formatter instead. If the specifier does not correspond to a valid unit formatter, then the generic string version is used, and the format code applied to that generic string.
get_format would fail when a format didn't exist, as __all__ contained the function get_format itself. This squashes that bug using inspect.isclass instead of a cludgy slice of __all__
Thanks to @mdbooms suggestion, I realized I fixed a single bug, but added some poor code for others. This relies on error catching in __format__ to determine if a specified format exists or not, instead of a new `has_format` method
Units can use format codes in new-style format strings to set the desired formatting builder.
It is a list of formats that can be found by get_format()
(which didn't work)
add missing import
Add a "show_in_browser" feature for tables
Rebased in eteq/expand-flux-conv to clean up commit log a bit
…n-doc-issue-1567 Remove incorrect description of setting a configuration value at runtime
update nduncertainty for multiple/divide
Some minor syntax cleanup as well.
…ges to units.quantity and units.astrophys packages.
Author
|
Sorry, I rebased when introducing the |
Owner
|
Thanks, @mhvk . I am guessing the commits that I should look at are the last 5 done by you? |
pllim
pushed a commit
that referenced
this pull request
Feb 11, 2014
Display 'alt' correctly in wcslint
Owner
|
Not needed anymore. |
pllim
pushed a commit
that referenced
this pull request
Jun 1, 2016
Finalizes attribute and frame naming conventions for AstrometricFrame and subclasses.
pllim
pushed a commit
that referenced
this pull request
Jan 10, 2017
fixes for test_wcs. Yields removed to get rid of deprecation warnings in pytest3 and be compatible with pytest4
pllim
pushed a commit
that referenced
this pull request
Jan 23, 2017
Remove unit checks that are irrelevant for the bug fix.
pllim
pushed a commit
that referenced
this pull request
Apr 26, 2017
pllim
pushed a commit
that referenced
this pull request
Feb 3, 2021
Updated docstring of autopower in core.py
pllim
pushed a commit
that referenced
this pull request
Mar 30, 2022
break out into test_constellation_edge_cases
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See main thread