titipata / pubmed_parser

:clipboard: A Python Parser for PubMed Open-Access XML Subset and MEDLINE XML Dataset
http://titipata.github.io/pubmed_parser/
MIT License
559 stars 164 forks source link

medline_parser has syntax error: `"is not" with a literal` #104

Closed TiansuYu closed 2 years ago

TiansuYu commented 2 years ago

The bug is as follows: (Should I open a PR for this?) Describe the bug

/opt/venv/lib/python3.8/site-packages/pubmed_parser/medline_parser.py:563: SyntaxWarning: "is not" with a literal. 
Did you mean "!="?
  if author.get("affiliation", "") is not ""

To Reproduce

with open(xml_url, "rb") as f:
    if not parse_grant_id:
        articles = pubmed_parser.parse_medline_xml(gzip.decompress(f.read()))
    else:
        articles = pubmed_parser.parse_medline_grant_id(gzip.decompress(f.read()))
df = pd.DataFrame(articles)

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Dependencies Debian Docker image + pubmed_parser=0.3.0

Additional context Add any other context about the problem here.

titipata commented 2 years ago

@TiansuYu definitely, please open the PR to fix the issue! Thanks a ton.