gregreen / dustmaps

A uniform interface for a number of 2D and 3D maps of interstellar dust reddening/extinction.
GNU General Public License v2.0
67 stars 22 forks source link

Trying to fetch a dust map raises a JSONDecodeError #54

Open ahlamaq opened 6 months ago

ahlamaq commented 6 months ago

I am trying to download one of the dust maps and encounter the following error, regardless of whether I try to download the map via pip [ eg. dustmaps.bayestar.fetch() ] or manually via setup.py [ eg. python setup.py fetch --map-name=bayestar ]:

File "/anaconda3/lib/python3.11/site-packages/dustmaps/bayestar.py", line 628, in fetch
    fetch_utils.dataverse_download_doi(
  File "/anaconda3/lib/python3.11/site-packages/dustmaps/fetch_utils.py", line 400, in dataverse_download_doi
    metadata = dataverse_search_doi(doi)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/anaconda3/lib/python3.11/site-packages/dustmaps/fetch_utils.py", line 367, in dataverse_search_doi
    return json.loads(r.text)
           ^^^^^^^^^^^^^^^^^^
  File "/anaconda3/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/anaconda3/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/anaconda3/lib/python3.11/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

This error is actually raised regardless of which dust map I try to download. Any help in resolving this would be much appreciated, since I cannot currently access any of the dust maps from this package.

gregreen commented 4 months ago

I am unable to reproduce this error. Can you check if it still occurs for you? I suspect that it had something to do with the Harvard Dataverse returning an invalid JSON response.

gregreen commented 4 months ago

Just to expand on this, it's possible that this is related to Issue #40, which was a problem with the Harvard Dataverse.

genghisken commented 1 month ago

Hi - I see this DOI retrieval issue has recurred for us today (my code initiates the fetch of the dustmaps if they are not already present). This appears to be a recurring problem with the Dataverse server at Harvard. Can anyone confirm that this is a server issue?

Exception Type: JSONDecodeError
Expecting value: line 1 column 1 (char 0)