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
Fix a few issues with generate_config #10893
Conversation
When using it with astroquery, this fixes 2 issues: - Astropy modules where imported and then added to the config file. - One module (`astroquery.mpc`) was added 3 times because it is imported in other modules.
what do you mean exactly? It's imported into the pseudo module
if there are obsessive logging/warnings, we can certainly look into that and do a cull. Could you provide examples? |
Yes, it happens when importing
Sure, this is only when filtering only deprecation warnings: https://gist.github.com/saimn/a18203a6ca86e6c573af0b53fb9b0d37 |
Glad to hear that master is being fixed, I recall a few back and forth of how to deal with those erfa things.
Ahh, thanks. We should raise errors for deprecations, so if any of those are around that's a real issue (with the exception of deprecations coming from pyregion or html5lib). Could you report them back in an astroquery issue? Most of those are legit warnings, and the rest is already on the radar to be cleaned up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While making changes in this function anyways, how does my idea in this comment sound #10877 (comment) ?
@@ -23,7 +23,7 @@ | |||
from contextlib import contextmanager | |||
|
|||
from astropy.extern.configobj import configobj, validate | |||
from astropy.utils import find_current_module | |||
from astropy.utils import find_current_module, silence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these years, I didn't know this existed. 😱
Lines 62 to 64 in 079fcb7
@contextlib.contextmanager | |
def silence(): | |
"""A context manager that silences sys.stdout and sys.stderr.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
@saimn , perhaps you should answer @embray 's question about #10877 (comment) before merge? |
Okay then, let's continue discussion on the other issue. Thanks, everyone! |
When using it with other packages (tried this with astroquery), this fixes several issues:
astroquery.mpc
) was added 3 times because it is imported in other modules.