Add unit_support() to enable quantity and time support together#17979
Add unit_support() to enable quantity and time support together#17979elmostafa-abdelaal wants to merge 6 commits into
Conversation
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
There was a problem hiding this comment.
Welcome to Astropy 👋 and congratulations on your first pull request! 🎉
A project member will respond to you as soon as possible; in the meantime, please have a look over the Checklist for Contributed Code and make sure you've addressed as many of the questions there as possible.
If you feel that this pull request has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail feedback@astropy.org.
neutrinoceros
left a comment
There was a problem hiding this comment.
Hi @elmostafa-abdelaal, thanks for your contribution and sorry for the long wait !
I pointed a couple undue changes in your PR, but the most important thing is that it's missing a test. Please let us know if you need help writing one. Thank you !
There was a problem hiding this comment.
We do not edit this file directly in PRs. Instead, please add a note as a new file, as described in docs/changes/README.rst.
| import numpy as np | ||
|
|
||
| __all__ = ["quantity_support"] | ||
| __all__ = ["quantity_support", "unit_support"] # ✅ أضفنا unit_support هنا |
There was a problem hiding this comment.
We only allow comments in english, so most contributors can understand them
| __all__ = ["quantity_support", "unit_support"] # ✅ أضفنا unit_support هنا | |
| __all__ = [ | |
| "quantity_support", | |
| "unit_support", | |
| ] |
| ... plt.figure() | ||
| ... plt.plot([1, 2, 3] * u.m) | ||
| [...] | ||
| ... |
There was a problem hiding this comment.
please revert this line
| ... | ||
| ... plt.plot([101, 125, 150] * u.cm) | ||
| [...] | ||
| ... |
| """ | ||
| Enable both quantity and time support for matplotlib. | ||
|
|
||
| This is a convenience function that enables both astropy's |
There was a problem hiding this comment.
I don't recall seeing that style in our docs, let's avoid it
| This is a convenience function that enables both astropy's | |
| This is a convenience function that enables both |
There was a problem hiding this comment.
this file also shouldn't be updated in this PR
| .. function:: unit_support(format="latex_inline") | ||
|
|
||
| Enable both quantity and time support for matplotlib. | ||
|
|
||
| :param format: Format for unit labels (default: 'latex_inline'). | ||
| :returns: Context manager enabling both supports. |
There was a problem hiding this comment.
I don't think this is needed: ref_api will automatically generate the text we want to include here
|
Hi humans 👋 - this pull request hasn't had any new commits for approximately 4 months. I plan to close this in 30 days if the pull request doesn't have any new commits by then. In lieu of a stalled pull request, please consider closing this and open an issue instead if a reminder is needed to revisit in the future. Maintainers may also choose to add keep-open label to keep this PR open but it is discouraged unless absolutely necessary. If this PR still needs to be reviewed, as an author, you can rebase it to reset the clock. If you believe I commented on this pull request incorrectly, please report this here. |
|
I'm going to close this pull request as per my previous message. If you think what is being added/fixed here is still important, please remember to open an issue to keep track of it. Thanks! If this is the first time I am commenting on this issue, or if you believe I closed this issue incorrectly, please report this here. |
Description
This pull request is to fix #8860
Alternative to #17575