GithubHelp home page GithubHelp logo

Comments (5)

bsipocz avatar bsipocz commented on August 28, 2024 1

As I recall the original BlankResponseWarning and then ugly parsing of the returned error/warning from the server was due to receiving a lot of bug reports where it was difficult to see what was going on (e.g. a response was returned, but we couldn't parse it out to a Table but instead gave an ugly traceback to the users. Anyway, none of these are necessary with the new backend, but still, having a warning for no results may be useful, and consistent with the rest of astroquery.

from astroquery.

ManonMarchand avatar ManonMarchand commented on August 28, 2024

Hi Laurent,
This method has changed since the last version. If you install from the master branch, the behavior is:

from astroquery.simbad import Simbad
from astropy.coordinates import SkyCoord, search_around_sky, Angle
import astropy.units as u

ra = 0
dec = -90
output_table= Simbad.query_region(SkyCoord(ra, dec,unit=(u.deg, u.deg), frame='icrs'), radius=0.01*u.arcsec)
print(output_table)
<Table length=0>
main_id    ra     dec   coo_err_maj coo_err_min coo_err_angle coo_wavelength coo_bibcode
          deg     deg       mas         mas          deg                                
 object float64 float64   float32     float32       int16          str1         object  
------- ------- ------- ----------- ----------- ------------- -------------- -----------

Which returns an empty table without any warning nor errors. What do you think about this new behavior?

from astroquery.

lmichel avatar lmichel commented on August 28, 2024

OK, I tried with the PIP distribution.
I close the issue.

from astroquery.

bsipocz avatar bsipocz commented on August 28, 2024

Ohhh. I haven't noticed the disappearance of the warning during the review. Can we reinstate e.g. a NoResultsWarning, that we try to do for most cases with logically valid queries but empty responses?

from astroquery.

ManonMarchand avatar ManonMarchand commented on August 28, 2024

Ohhh. I haven't noticed the disappearance of the warning during the review. Can we reinstate e.g. a NoResultsWarning, that we try to do for most cases with logically valid queries but empty responses?

My reasoning behind removing the warning was that by looking through astroquery, when a NoResultsWarning is emitted, the method most often returns None instead of a table. Sometimes it returns a plain empty Table() object without any columns, sometimes it returns the query parameters that lead to the empty response.

Here in SIMBAD, we return a valid table with zero rows but it contains at least the meta data of the columns that would have been returned. This can also be the expected result, for example when people do a ROW_LIMIT=0 or a TOP 0 query just to test their joins before sending a big query, or to check what columns are added by a votablefield, or to see if their ADQL syntax is correct (the server returns quite detailed warnings about the ADQL syntax).
So I guess when we add the warning back I'll filter these two cases just to be sure that it does not become annoying for these use cases?

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.