lbl-anp / becquerel

Becquerel is a Python package for analyzing nuclear spectroscopic measurements.
Other
43 stars 16 forks source link

Fix nndc._request() #379

Closed tannerdalen closed 11 months ago

tannerdalen commented 11 months ago

As of about two weeks ago, requesting data from .jsp sites (like https://www.nndc.bnl.gov/nudat3/sigma_searchi.jsp) for wallet card and decay data information began returning empty request errors: "NNDCRequestError: Request failed: "

image

After speaking with a Technology Analyst at Brookhaven, they concluded a few things. sigma_searchi.jsp provides a response object with "ok == True" and "status_code == 200". It's "reason" field is set to an empty string instead of "OK". In line 439, the 'resp.reason != "OK"' condition causes _request() to fail, despite NNDC returning data. Removing this condition fixes it and returns data successfully.

image

markbandstra commented 11 months ago

Wow, thanks @TannerDalen for digging into this! Some of us had started to notice this problem but hadn't looked into it. Glad it is a simple fix.

Hope you are getting good use out of becquerel, please let us know when you notice other bugs or have other features you would like to see!

tannerdalen commented 11 months ago

Awesome, will do. Thanks!