astroquery icon indicating copy to clipboard operation
astroquery copied to clipboard

Limit usage of `**kwargs` to raise error for non functional kwargs of the common API

Open bsipocz opened this issue 4 years ago • 3 comments

The following query should raise an error rather than pass as clearly the timeout has no effect

>>> from astroquery.mast import Catalogs
>>> %time catalog_data = Catalogs.query_object("158.47924 -7.30962", catalog="TIC", timeout=0.1, radius='1d')
CPU times: user 1.7 s, sys: 191 ms, total: 1.89 s
Wall time: 7.84 s

bsipocz avatar Jul 09 '21 18:07 bsipocz

Hi @bsipocz , I'm looking into this to get some practice debugging: Is the timeout parameter in units of seconds? So the problem is that parameter isn't doing anything to keep the call from running past 0.1s - could this have to do with the parameter itself? I'm seeing that it gets inherited from here https://github.com/astropy/astroquery/blob/729cf6db1552fd7ea5b2695d9ddaa6903513470b/astroquery/query.py#L451 but not sure what part of the code in here enforces the timeout.

jaymedina avatar Oct 01 '21 16:10 jaymedina

Is the timeout parameter in units of seconds

Yes, it should be

So the problem is that parameter isn't doing anything to keep the call from running past 0.1s - could this have to do with the parameter itself? I'm seeing that it gets inherited from here

Yes, it may be inherited, but maybe not used in the code itself, as was just passed around and silently swallowed as part of **kwargs usage. Or it may be taken into account but other part of the query takes longer than 0.1 and it adds up (I think it's very unlikely, but one needs to check the code to be sure).

bsipocz avatar Oct 01 '21 18:10 bsipocz

this same issue came up for alma, here is the workaround they applied: #2475

bsipocz avatar Aug 09 '22 19:08 bsipocz