Coder Social home page Coder Social logo

Comments (8)

orionlee avatar orionlee commented on July 23, 2024

Inspecting a few other packages,

from astroquery.

keflavich avatar keflavich commented on July 23, 2024

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.

from astroquery.

orionlee avatar orionlee commented on July 23, 2024

There are two issues here.

  1. changing with config file. Somehow it does not work, as if astroquery.cfg is ignored. I don't think it is raised in other issues.

  2. changing at runtime: it is of the same nature of #2993 (for astrometry.net) and #2291 (for SIMBAD)

from astroquery.

keflavich avatar keflavich commented on July 23, 2024

Ahhh, ok, issue 1 is new, you're right. That is a bug.

from astroquery.

orionlee avatar orionlee commented on July 23, 2024

For issue 1, the vizier config in file astroquery.cfg is ignored, I've reproduced it in Linux and WSL2 as well.

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 Vizier() object, e.g., Vizier(vizier_server="vizier.cfa.harvard.edu").


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:

  • WSL2: astroquery 0.4.6, astropy: 5.2.1, Python 3.8
  • Linux (Ubuntu 20.404): astroquery: 0.4.6, astropy: 5.3.4, Python 3.11

from astroquery.

orionlee avatar orionlee commented on July 23, 2024

For issue 1, static config issue, it turns out the config parameter name for Vizier server is server, rather than vizier_server .

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 because it is in the generated astroqueryc.cfg:

# vizier_server = vizier.cds.unistra.fr

It looks like the parameter was renamed from vizier_server to server at some astroquery version, and the generated astroqueryc.cfg was from created from some old version of astroquery.

Re-generating astroqueryc.cfg would produce a new config file with correct parameter names.

from astropy.config import create_config_file
create_config_file('astroquery', overwrite=True)

from astroquery.

keflavich avatar keflavich commented on July 23, 2024

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.

from astroquery.

orionlee avatar orionlee commented on July 23, 2024

There might still be a problem that somehow an outdated astroquery.cfg is somehow generated.

  1. I do not know when it was first generated on my machine, but it is in 2020s.
  2. in a hosted environment I got in May this year (about a month ago), https://timeseries.science.stsci.edu/ , the astroquery.cfg there also has the same outdated parameter names. The vizier section of astroquery.cfg there:
[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 astroquery.cfg there is first generated. But it should be somewhat recent (unless their hosted environment copies some outdated version manually in their process)

The software version there is astroquery 0.4.6, astropy 5.3.4


The vizier section in the above astroquery.cfg is different from the generated one using create_config_file()

[vizier]

## Name of the VizieR mirror to use.
# server = vizier.cds.unistra.fr
...

The generated one

  • has the correct parameter name server
  • does not have the nice description listing out all the mirrors
  • the commented default value is different, with the more recent cds.unistra.fr domain.

It is as if even if a practically brand new hosted environment, an outdated astroquery.cfg still gets somehow generated.

from astroquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.