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

Astroquery AtomicLineList query error #2065

Closed
Abelink23 opened this issue May 11, 2021 · 2 comments · Fixed by #2088
Closed

Astroquery AtomicLineList query error #2065

Abelink23 opened this issue May 11, 2021 · 2 comments · Fixed by #2088

Comments

@Abelink23
Copy link

Description

I am trying to follow the guide described in:
https://astroquery.readthedocs.io/en/latest/atomic/atomic.html

Expected behaviour

Receive a list of atomic lines.

Actual behaviour

Received this traceback.

AttributeError                            Traceback (most recent call last)
<ipython-input-16-a5121dcb718d> in <module>
----> 1 AtomicLineList.query_object(wavelength_range, wavelength_type='Air', wavelength_accuracy=20, element_spectrum='C II-IV')

/opt/anaconda3/lib/python3.8/site-packages/astroquery/atomic/core.py in query_object(self, wavelength_range, wavelength_type, wavelength_accuracy, element_spectrum, minimal_abundance, depl_factor, lower_level_energy_range, upper_level_energy_range, nmax, multiplet, transitions, show_fine_structure, show_auto_ionizing_transitions, output_columns)
    165             show_auto_ionizing_transitions=show_auto_ionizing_transitions,
    166             output_columns=output_columns)
--> 167         table = self._parse_result(response)
    168         return table
    169 

/opt/anaconda3/lib/python3.8/site-packages/astroquery/atomic/core.py in _parse_result(self, response)
    256 
    257     def _parse_result(self, response):
--> 258         data = StringIO(BeautifulSoup(response.text).find('pre').text.strip())
    259         # `header` is e.g.:
    260         # "u'-LAMBDA-VAC-ANG-|-SPECTRUM--|TT|--------TERM---------|---J-J---|----LEVEL-ENERGY--CM-1----'"

AttributeError: 'NoneType' object has no attribute 'text'

System Details

macOS Catalina 10.15.7
Python 3.8.5
astropy 4.2.1
astroquery 0.4.1
beautifulsoup4 4.9.3
numpy 1.19.2

@keflavich
Copy link
Contributor

I confirm that this is failing:

ipdb> print(response.text)
<HTML>
<HEAD><TITLE>Query results</TITLE></HEAD>
<BODY BACKGROUND="dot_yellow.gif">
<CENTER><H2>Query results</H2></CENTER>
<P>
*** ERROR: request form contains no information.
    The client and server are not communicating. properly.
    Please restart your browser or reboot your computer.
    If this does not help, report the problem to p.vanhoof@oma.be.
<BR><HR><BR>
<a HREF=index.html><img src=left_arrow.gif width=25 height=25 align=middle hspace=8 alt="GO"></a>Back to the <a HREF=index.html>request form</a>.
</BODY>
</HTML>

Likely this means that the hacked-together "API" is broken because of upstream changes.

@keflavich
Copy link
Contributor

The problem is actually very simple, but was hard for me to find... they moved to https.

Bugfix in #2088

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.

3 participants