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

Default to verbose=False upon TapPlus instantiation #1722

Closed
profjsb opened this issue May 21, 2020 · 8 comments · Fixed by #2228
Closed

Default to verbose=False upon TapPlus instantiation #1722

profjsb opened this issue May 21, 2020 · 8 comments · Fixed by #2228

Comments

@profjsb
Copy link

profjsb commented May 21, 2020

When instantiating a subclass of the TapPlus class (e.g. GaiaClass), the connection info is printed to stdout:

>>> from astroquery.gaia import Gaia 
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

Since Gaia = GaiaClass and GaiaClass is a subclass of TapPlus this import statement appears to establish the relevant connections and show them using the default verbose=True for TapPlus. Since verbose-by-default statements can pollute log files which capture stdout, it would be good to have verbosity turned off by default (either in GaiaClass or TapPlus itself). Alternatively, this could be controlled in a config file.

I'm happy to make a PR to implement verbose=False for TapPlus but I thought it was enough of a behavior change that it would be good to have a discussion of this first.

@bsipocz
Copy link
Member

bsipocz commented May 21, 2020

I would support this proposal (to default verbose to False at impor time) , but let's ping the gaia folks @jcsegovia for their insight

@bsipocz
Copy link
Member

bsipocz commented May 21, 2020

(We have the switch to use tap from pyvo on the roadmap, so some behaviour change will definitely happen)

@profjsb
Copy link
Author

profjsb commented Aug 12, 2020

Just a ping on this, @jcsegovia. Switching the default to False is still of interest.

@jpl-jengelke
Copy link
Contributor

jpl-jengelke commented Jun 18, 2021

Please change the default to False. I feel like instantiating a subclass wrapping GaiaClass just to turn off this intrusive print statement.

jpl-jengelke added a commit to rzellem/EXOTIC that referenced this issue Jun 18, 2021
…ation to display AstroQuery's GAIA TAP+ warnings (actually print statements, oops) before load complete acknowledgement. The Gaia warnings issue is a bug at astropy/astroquery#1722 . Note: Order of imports is important here, please keep order in this commit.
@keflavich
Copy link
Contributor

👍 I'm also in favor of defaulting to non-verbose. A PR would be welcome.

@jpl-jengelke
Copy link
Contributor

@keflavich -- Here is your pull request: #2085

@jpl-jengelke
Copy link
Contributor

jpl-jengelke commented Jun 20, 2021

Making this change I am a little concerned that there may be instances where verbosity is helpful to verify network connections. I should note the fact that this class instantiates in verbose mode is currently an oversight. It appears that in all other parts of Gaia the verbosity is explicitly set or defaults to False. So adding this change should serve to fulfill the original intent of the code.

In reference to changing the default behavior, the Gaia core class also could be modified to accept a setting to change verbosity:

  1. Possibly a config value to set verbosity
  2. Alternately an environment variable to set verbosity.

I don't know if there are such mechanisms in Astropy/Astroquery today that would allow implementing either of these solutions. I also don't think it's absolutely necessary.

jpl-jengelke added a commit to jpl-jengelke/astroquery that referenced this issue Jun 20, 2021
jpl-jengelke added a commit to jpl-jengelke/astroquery that referenced this issue Jun 20, 2021
Referenced astropy#1722 for changes to default GAIA verbosity (make it run silently on instantiation).
@keflavich
Copy link
Contributor

@jpl-jengelke there are configuration mechanisms in place that would allow what you suggest. And, indeed, verbosity can be helpful for diagnosing network issues - but instantiation of the class is probably not the right time to do that.

bsipocz added a commit that referenced this issue Jun 20, 2021
Issue #1722: Turn off verbose Tap Plus messages
keflavich pushed a commit to keflavich/astroquery that referenced this issue Sep 13, 2021
keflavich pushed a commit to keflavich/astroquery that referenced this issue Sep 13, 2021
Referenced astropy#1722 for changes to default GAIA verbosity (make it run silently on instantiation).
syed-gilani pushed a commit to syed-gilani/astroquery that referenced this issue Mar 11, 2022
syed-gilani pushed a commit to syed-gilani/astroquery that referenced this issue Mar 11, 2022
Referenced astropy#1722 for changes to default GAIA verbosity (make it run silently on instantiation).
burnout87 pushed a commit to oda-hub/astroquery that referenced this issue May 10, 2022
burnout87 pushed a commit to oda-hub/astroquery that referenced this issue May 10, 2022
Referenced astropy#1722 for changes to default GAIA verbosity (make it run silently on instantiation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants