From 383c62b76bb3ecf49b01c6533145d4613a082b7c Mon Sep 17 00:00:00 2001 From: EverVino Date: Thu, 23 May 2024 11:51:30 -0400 Subject: [PATCH] add comments to explain code --- src/pymedx/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pymedx/api.py b/src/pymedx/api.py index 6f54d19..f52b686 100644 --- a/src/pymedx/api.py +++ b/src/pymedx/api.py @@ -98,6 +98,8 @@ def query( total_articles = self.getTotalResultsCount(query) + # check if total articles is greater than MAX_RECORDS_PM + # and check it the user requests more than MAX_RECORDS_PM if total_articles > MAX_RECORDS_PM and max_results > MAX_RECORDS_PM: article_ids = self._getArticleIdsMore10k(query=query) @@ -273,7 +275,8 @@ def _getArticleIdsMore10k(self, query: str) -> list[str]: f"Your query: {query} returns more than 9 999 results. " "PubMed database can only retrieve 9 999 records matching " "the query. " - "Consider adding range date restriction to your query " + "Consider reducing the value of max_result to less than 9999" + "or adding range date restriction to your query " " in the following format: \n" '() AND ("YYYY/MM/DD"[Date - Publication]' ' : "YYYY/MM/DD"[Date - Publication])'