Skip to content

Commit

Permalink
add comments to explain code
Browse files Browse the repository at this point in the history
  • Loading branch information
EverVino committed May 23, 2024
1 parent 013f0d0 commit 383c62b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pymedx/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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"
'(<your query>) AND ("YYYY/MM/DD"[Date - Publication]'
' : "YYYY/MM/DD"[Date - Publication])'
Expand Down

0 comments on commit 383c62b

Please sign in to comment.