From 6aa8a17e809f8c9c7adb59e3fd88977fbdc7972c Mon Sep 17 00:00:00 2001 From: "Michael E. Rose" Date: Wed, 18 Dec 2024 09:53:45 +0100 Subject: [PATCH] Fix tests and doc strings --- pubmed_parser/medline_parser.py | 6 +++--- pubmed_parser/pubmed_oa_parser.py | 3 +-- tests/test_pubmed_web_parser.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pubmed_parser/medline_parser.py b/pubmed_parser/medline_parser.py index be74eb8..31a469e 100644 --- a/pubmed_parser/medline_parser.py +++ b/pubmed_parser/medline_parser.py @@ -568,6 +568,7 @@ def parse_article_info( if True, parse reference list as an output parse_subs: bool if True, parse mesh terms with subterms + Returns ------- article: dict @@ -703,8 +704,7 @@ def parse_medline_xml( parse_downto_mesh_subterms=False ): """Parse XML file from Medline XML format available at - https://ftp.ncbi.nlm.nih.gov/pubmed/ - + https://ftp.ncbi.nlm.nih.gov/pubmed/. Parameters ---------- @@ -734,7 +734,7 @@ def parse_medline_xml( default: False parse_downto_mesh_subterms: bool if True, return mesh terms concatenated with "; " and mesh subterms concatenated " / " - and appended with * if the subterm is major + and appended with * if the subterm is major if False, return mesh_terms concatenated with "; " default: False diff --git a/pubmed_parser/pubmed_oa_parser.py b/pubmed_parser/pubmed_oa_parser.py index 49154eb..156352a 100644 --- a/pubmed_parser/pubmed_oa_parser.py +++ b/pubmed_parser/pubmed_oa_parser.py @@ -160,8 +160,7 @@ def parse_pubmed_xml(path, include_path=False, nxml=False): A dictionary contains a following keys from a parsed XML path 'full_title', 'abstract', 'journal', 'pmid', 'pmc', 'doi', 'publisher_id', 'author_list', 'affiliation_list', 'publication_year', - 'publication_date', 'epublication_date' ,'subjects' - } + 'publication_date', 'epublication_date', 'subjects' """ tree = read_xml(path, nxml) diff --git a/tests/test_pubmed_web_parser.py b/tests/test_pubmed_web_parser.py index b01db07..8641911 100644 --- a/tests/test_pubmed_web_parser.py +++ b/tests/test_pubmed_web_parser.py @@ -96,4 +96,4 @@ def test_version(): xml_21113338 = pp.parse_xml_web('21113338') assert xml_21113338['version_id'] == '3' - assert xml_21113338['version_date'] is None + assert xml_21113338['version_date'] == '2011/04/07'