tardis-sn / carsus

Atomic Database for Astronomy
https://tardis-sn.github.io/carsus
21 stars 45 forks source link

NISTIonizationEnergies accesses a NIST website that sometimes rejects access #391

Open andrewfullard opened 10 months ago

andrewfullard commented 10 months ago

This causes tests to fail and would affect running Carsus from non-institutional connections, as well as running into timeouts.

nvieira-mcgill commented 6 months ago

What exactly does the error traceback look like for this? I am getting the following when I use NISTIonizationEnergies in any way:

  File "/home/nvieira/carsus/lib/python3.6/site-packages/carsus-0.1.dev0-py3.6.egg/carsus/io/nist/ionization.py", line 310, in __init__
    self.parser = NISTIonizationEnergiesParser(input_data)
  File "/home/nvieira/carsus/lib/python3.6/site-packages/carsus-0.1.dev0-py3.6.egg/carsus/io/base.py", line 37, in __init__
    self.load(input_data)
  File "/home/nvieira/carsus/lib/python3.6/site-packages/carsus-0.1.dev0-py3.6.egg/carsus/io/nist/ionization.py", line 84, in load
    for a in pre_tag.find_all("a"):
AttributeError: 'NoneType' object has no attribute 'find_all'

I'm using an older version of carsus (which I'm currently updating in case that fixes anything) but have never encountered this issue, and am wondering if this is the issue I'm facing.

andrewfullard commented 2 months ago

This is partially resolved by pointing to our mirror https://github.com/tardis-sn/carsus/blob/master/carsus/io/nist/ionization.py#L28 but we also pull the version from NIST directly, which may become mismatched in the future.