Skip to content
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

Warnings/logging messages when importing sub-packages #1866

Closed
saimn opened this issue Oct 18, 2020 · 4 comments
Closed

Warnings/logging messages when importing sub-packages #1866

saimn opened this issue Oct 18, 2020 · 4 comments
Labels

Comments

@saimn
Copy link
Contributor

saimn commented Oct 18, 2020

Ref astropy/astropy#10893.
Importing all astroquery sub-packages raises a bunch of warning and logging messages:

/home/simon/.pyenv/versions/3.8.1/lib/python3.8/site-packages/astroquery/alfalfa/__init__.py:15: UserWarning: Experimental: ALFALFA has not yet been refactored to have its API match the rest of astroquery.
  warnings.warn("Experimental: ALFALFA has not yet been refactored to have "
WARNING: Astrometry.net API key not found in configuration file [astroquery.astrometry_net.core]
WARNING: You need to manually edit the configuration file and add it [astroquery.astrometry_net.core]
WARNING: You may also register it for this session with AstrometryNet.key = 'XXXXXXXX' [astroquery.astrometry_net.core]
Please install pyvo. astropy.cadc does not work without it.
Could not import mocpy, which is a requirement for the CDS service.Please refer to https://cds-astro.github.io/mocpy/install.html for how to install it.
Could not import astropy-regions, which is a requirement for the CDS service.Please refer to http://astropy-regions.readthedocs.io/en/latest/installation.html for how to install it.
Created TAP+ (v1.2.1) - Connection:
	Host: hst.esac.esa.int
	Use HTTPS: False
	Port: 80
	SSL Port: 443
Created TAP+ (v1.2.1) - Connection:
	Host: nxsa.esac.esa.int
	Use HTTPS: False
	Port: 80
	SSL Port: 443
/home/simon/.pyenv/versions/3.8.1/lib/python3.8/site-packages/astroquery/fermi/__init__.py:37: UserWarning: Experimental: Fermi-LAT has not yet been refactored to have its API match the rest of astroquery.
  warnings.warn("Experimental: Fermi-LAT has not yet been refactored to have "
Created TAP+ (v1.2.1) - Connection:
	Host: gea.esac.esa.int
	Use HTTPS: True
	Port: 443
	SSL Port: 443
Created TAP+ (v1.2.1) - Connection:
	Host: geadata.esac.esa.int
	Use HTTPS: True
	Port: 443
	SSL Port: 443
/home/simon/.pyenv/versions/3.8.1/lib/python3.8/site-packages/astroquery/lcogt/__init__.py:12: UserWarning: The LCOGT archive API has been changed. While we aim to accommodate the changes into astroqeury, pleased be advised that this module is not working at the moment.
  warnings.warn("The LCOGT archive API has been changed. While we aim to "
/home/simon/.pyenv/versions/3.8.1/lib/python3.8/site-packages/astroquery/ogle/__init__.py:40: UserWarning: Experimental: OGLE has not yet been refactored to have its API match the rest of astroquery.
  warnings.warn("Experimental: OGLE has not yet been refactored to have its "
/home/simon/.pyenv/versions/3.8.1/lib/python3.8/site-packages/astroquery/sha/__init__.py:14: UserWarning: Experimental: SHA has not yet been refactored to have its API match the rest of astroquery.
  warnings.warn("Experimental: SHA has not yet been refactored to have its "
/home/simon/.pyenv/versions/3.8.1/lib/python3.8/site-packages/astroquery/vamdc/core.py:112: UserWarning: vamdclib could not be imported; the vamdc astroquery module will not work
  warnings.warn("vamdclib could not be imported; the vamdc astroquery module "
Could not import regions, which is required for some of the functionalities of this module.
@bsipocz
Copy link
Member

bsipocz commented Oct 18, 2020

Of these some are on the radar, and some I think should stay:

  • Default to verbose=False upon TapPlus instantiation #1722 is about turning off the TAP info.
  • the import warnings are better kept, but the pyvo one can be turned to an error as pyvo is now a mandatory dependency
  • we should delete the lcogt module rather than issuing the warning
  • maybe we need to reconsider the alfaalfa, sha, ogle warnings about the refactoring, it is not very useful for the user

@bsipocz
Copy link
Member

bsipocz commented Oct 18, 2020

@saimn - you mentioned some deprecations, are any of those relevant for astroquery? (pyregions and html5lib ones are ignored, but all the rest should be dealt with)

@saimn
Copy link
Contributor Author

saimn commented Oct 18, 2020

No sorry, I meant taht generate_config already filters deprecation warnings, but it seems that there are no such warning for astroquery. Btw to reproduce and import all sub-packages:

In [1]: import pkgutil, importlib, astroquery
   ...: for mod in pkgutil.walk_packages(astroquery.__path__, prefix='astroquery.'):
   ...:     importlib.import_module(mod.name)

@bsipocz
Copy link
Member

bsipocz commented Nov 9, 2022

Some things got cleaned up, and all of the remaining warnings are meant to be raised at import time for modules that have some issues, so I go ahead and close this now.

maybe we need to reconsider the alfaalfa, sha, ogle warnings about the refactoring, it is not very useful for the user

And I would say we should remove the warnings for these along #2110 and #2555

@bsipocz bsipocz closed this as completed Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants