You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now I am using astroquery as a dependency for a package, and have doc tests that involve my module. These occasionally break, because of gaia status messages which get printed directly to stdout.
That's fair enough, I think most users might want to see these messages by default. However, I would personally like to switch them off. So I try using the kwarg argument to switch them off:
from astroquery.gaia import GaiaClass
Gaia = GaiaClass(show_server_messages=False)
That creates a GaiaClass object, and uses the default settings (i.e show_server_message=True). So, by time I've hit the line from astroquery.gaia import GaiaClass I already get the stdout message.
As a workaround I can send things to dev null for that one specific import line, but it seems to me like the show_server_message argument is not behaving as intended, so I thought I would create the github issue here first.
Options I can think of to fix this include be to using the python logger rather than print (then I can toggle the message on/off), have the default of the printing set by an environment level, or setting a default of show_server_message=False. Apologies if a discussion about this already exists.
The text was updated successfully, but these errors were encountered:
Right now I am using
astroquery
as a dependency for a package, and have doc tests that involve my module. These occasionally break, because of gaia status messages which get printed directly to stdout.astroquery/astroquery/gaia/core.py
Line 1025 in ade38dc
That's fair enough, I think most users might want to see these messages by default. However, I would personally like to switch them off. So I try using the kwarg argument to switch them off:
which makes use of:
astroquery/astroquery/gaia/core.py
Line 89 in ade38dc
In theory that should work, but right at the bottom of the script defining the
GaiaClass
class, there is this line:astroquery/astroquery/gaia/core.py
Line 1048 in ade38dc
That creates a
GaiaClass
object, and uses the default settings (i.eshow_server_message=True
). So, by time I've hit the linefrom astroquery.gaia import GaiaClass
I already get the stdout message.As a workaround I can send things to dev null for that one specific import line, but it seems to me like the
show_server_message
argument is not behaving as intended, so I thought I would create the github issue here first.Options I can think of to fix this include be to using the python logger rather than print (then I can toggle the message on/off), have the default of the printing set by an environment level, or setting a default of
show_server_message=False
. Apologies if a discussion about this already exists.The text was updated successfully, but these errors were encountered: