Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Improve code readablity in grblc.search.ads
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsm committed Jun 7, 2022
1 parent 6771186 commit c50827f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion grblc/convert/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import glob2
import numpy as np
import pandas as pd
from astropy import constants as const
from astropy import units as u
from astropy.time import Time

Expand Down
4 changes: 2 additions & 2 deletions grblc/search/ads/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def getArticle(articlelist, article, GRB, firsttry=True, debug=False):
for record in records:
linktype = record["link_type"]
link = record["url"]
if "PDF" in linktype and not "doi.org" in link and not "$" in link:
if "PDF" in linktype and "doi.org" not in link and "$" not in link:
# switch any arxiv url to export.arxiv.org so we don't get locked out
url = link.replace("arxiv.org", "export.arxiv.org")
q = requests.get(url, stream=True, headers=pdf_header)
Expand All @@ -245,7 +245,7 @@ def getArticle(articlelist, article, GRB, firsttry=True, debug=False):
return
except:
linktype = deserialized["link_type"]
if "PDF" in linktype and not "doi.org" in link and not "$" in link:
if "PDF" in linktype and "doi.org" not in link and "$" not in link:
# switch any arxiv url to export.arxiv.org so we don't get locked out
url = deserialized["link"].replace("arxiv.org", "export.arxiv.org")
q = requests.get(url, stream=True, headers=pdf_header)
Expand Down

0 comments on commit c50827f

Please sign in to comment.