-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
Cannot change Vizier configuration value neither at runtime nor with config file due to outdated parameter name in astroquery.cfg #3018
Comments
Inspecting a few other packages,
|
This is a duplicate of #2993 - in short, we don't support the approach you're trying now, but we could (slowly) refactor to support it. |
There are two issues here.
|
Ahhh, ok, issue 1 is new, you're right. That is a bug. |
For issue 1, the vizier config in file Alongside with issue 2, runtime config is ignored, effectively one cannot configure Vizier at all. The only workaround is to explicitly pass along the parameters in constructing Test: In [1]: import astroquery; print("astroquery:", astroquery.__version__)
...: import astropy; print("astropy:", astropy.__version__)
...:
...: import astroquery.vizier as vizier
...: v = vizier.Vizier()
...: print(v.VIZIER_SERVER)
astroquery: 0.4.6
astropy: 5.2.1
vizier.u-strasbg.fr
In [2]: !grep vizier ~/.astropy/config/astroquery.cfg
[vizier]
# Options: vizier.u-strasbg.fr, vizier.nao.ac.jp, vizier.hia.nrc.ca, vizier.ast.cam.ac.uk, vizier.cfa.harvard.edu, www.ukirt.jach.hawaii.edu, vizier.iucaa.ernet.in, vizier.china-vo.org
#vizier_server = vizier.u-strasbg.fr
vizier_server = vizier.cfa.harvard.edu Versions:
|
For issue 1, static config issue, it turns out the config parameter name for Vizier server is This would be ignored [vizier]
vizier_server = vizier.cfa.harvard.edu While this would be honored: [vizier]
server = vizier.cfa.harvard.edu I use # vizier_server = vizier.cds.unistra.fr It looks like the parameter was renamed from Re-generating from astropy.config import create_config_file
create_config_file('astroquery', overwrite=True) |
Good detective work. It looks any new astroquery users are unaffected, but anyone who had an old version of the config (the change was 10 years ago, in c58b497, so congrats on being a long-time user!) would encounter the same problem as you. |
There might still be a problem that somehow an outdated
[vizier]
# Name of the VizieR mirror to use.
# Options: vizier.u-strasbg.fr, vizier.nao.ac.jp, vizier.hia.nrc.ca, vizier.ast.cam.ac.uk, vizier.cfa.harvard.edu, www.ukirt.jach.hawaii.edu, vizier.iucaa.ernet.in, vizier.china-vo.org
#vizier_server = vizier.u-strasbg.fr
# default timeout for connecting to server
#timeout = 60
# maximum number of rows that will be fetched from the result (set to -1 for
# unlimited).
#row_limit = 50 I do not know how / when the The software version there is astroquery 0.4.6, astropy 5.3.4 The vizier section in the above
The generated one
It is as if even if a practically brand new hosted environment, an outdated |
Sorry I failed to follow up on this. There is indeed an issue here, where the default name being produced in The question left to answer in this Issue is: are users' config files being generated incorrectly? Where and why? i.e., where/when does |
In the hosted https://timeseries.science.stsci.edu/ environment, it should be a fresh environment with recent versions (astroquery 0.4.6, astropy 5.3.4) But somehow the default |
I cannot change configuration values for
Vizier
, both at runtime viaconf
object, or at configuration file~/.astropy/config/astroquery.cfg
.astroquery.cfg
does not have any effect.UPDATE: The issue is because the parameter name is now
server
instead ofvizier_server
. See #3018 (comment) below.conf.server
does not have any effect either. More examples later.The issue of changing at runtime is similar to #2291 (for SIMBAD) and #2993 (for astrometry.net). The specifics are slightly different, but they all boil down to that the default value is read once at class loading time.
Example for runtime config issue
For illustration, I added a debug output at the end of
VizierClass.__init__()
:Test code
Output: it shows the updated value in
conf
object is not used.Workaround for runtime issue: Reload all relevant modules
Output
It could get tricky in practice to do proper reloading. If
Vizier
is imported to some other module, say,module_a
,module_a
would also need to be reloaded.Versions
astroquery: v0.4.7
astropy: v6.0.1
Platform: Windows 11
The text was updated successfully, but these errors were encountered: