Skip to content
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

TST BUG: cdms mocked example raises EmptyResponseError #3007

Closed
bsipocz opened this issue May 9, 2024 · 4 comments · Fixed by #3202
Closed

TST BUG: cdms mocked example raises EmptyResponseError #3007

bsipocz opened this issue May 9, 2024 · 4 comments · Fixed by #3202

Comments

@bsipocz
Copy link
Member

bsipocz commented May 9, 2024

There is a weird thing with the tests, that if one runs the patched example, it returns an EmptyResponseError. I wonder if we could use examples, even for the local tests that should work when actually querying the server?

>>> from astroquery.linelists.cdms import CDMS
>>> from astropy import units as u
>>> tbl = CDMS.query_lines(min_frequency=100 * u.GHz,
...                                max_frequency=1000 * u.GHz,
...                                min_strength=-500,
...                                molecule="CO")
EmptyResponseError                        Traceback (most recent call last)
Cell In[1], line 3
      1 from astroquery.linelists.cdms import CDMS
      2 from astropy import units as u
----> 3 tbl = CDMS.query_lines(min_frequency=100 * u.GHz,
      4                                max_frequency=1000 * u.GHz,
      5                                min_strength=-500,
      6                                molecule="CO")

File ~/munka/devel/astroquery/astroquery/utils/class_or_instance.py:25, in class_or_instance.__get__.<locals>.f(*args, **kwds)
     23 def f(*args, **kwds):
     24     if obj is not None:
---> 25         return self.fn(obj, *args, **kwds)
     26     else:
     27         return self.fn(cls, *args, **kwds)

File ~/munka/devel/astroquery/astroquery/utils/process_asyncs.py:26, in async_to_sync.<locals>.create_method.<locals>.newmethod(self, *args, **kwargs)
     22 @class_or_instance
     23 def newmethod(self, *args, **kwargs):
     24     verbose = kwargs.pop('verbose', False)
---> 26     response = getattr(self, async_method_name)(*args, **kwargs)
     27     if kwargs.get('get_query_payload') or kwargs.get('field_help'):
     28         return response

File ~/munka/devel/astroquery/astroquery/linelists/cdms/core.py:165, in CDMSClass.query_lines_async(self, min_frequency, max_frequency, min_strength, molecule, temperature_for_intensity, flags, parse_name_locally, get_query_payload, cache)
    163         break
    164 if not ok:
--> 165     raise EmptyResponseError("Did not find table in response")
    167 baseurl = self.URL.split('cgi-bin')[0]
    168 fullurl = f'{baseurl}/{url}'

EmptyResponseError: Did not find table in response

@bsipocz
Copy link
Member Author

bsipocz commented Feb 4, 2025

@keflavich - this is still around after the recent fixes

@keflavich
Copy link
Contributor

The error message from the server is funny:

<h3>Ups! Code: 011</h3><p>Something went through the roof!</p>
<p>please contact <strong>[email protected]</strong>!
</p>

I'm searching for the underlying cause; the server is still responsive via the web.

@keflavich
Copy link
Contributor

Is the problem that running this test un-patched is giving that error?

There is a simple enough solution, which is to store the file more correctly named, i.e. '028503 CO, v=0.dat' instead of 'CO.dat', and then add parse_names_locally into each of those queries. I can do that, I'm just a little afraid of weird filenames with spaces and commas.

@bsipocz
Copy link
Member Author

bsipocz commented Feb 4, 2025

Is the problem that running this test un-patched is giving that error?

Yeap, I would say we should have a query that works out of the box for the mock example rather than something arbitrary, so we need to change the mocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants