-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase number of citations returned by citedby #446
Increase number of citations returned by citedby #446
Conversation
…-package/develop Release v1.7.2
I would normally ask people to add a unit test that covers the new addition, but I don't think we should have a test that will scrape 100+ pages :-| |
I want to merge #445 to |
53385c3
to
dde44c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good starting point for me to work on this, but I don't think I want to merge this as it is. I'm going to change the base branch to another branch so I could clean it up a bit more. I will also cook up a unit test that will still cover the newly added code.
self.logger.warning("Object not supported for bibtex exportation") | ||
return | ||
|
||
if object["bib"]["citedby"] < 999: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be <= 1000
pub_id = int(object["citedby_url"].split("=")[1].split("&")[0]) | ||
iter_list = [] | ||
while year_low < year_end: | ||
iter_list.append(self.search_citedby(publication_id=pub_id, year_low=year_low, year_high=year_low+1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
year_high
should be the same as year_low
. This actually fetches citations from two years instead of one year.
iter_list.append(self.search_citedby(publication_id=pub_id, year_low=year_low, year_high=year_low+1)) | ||
year_low += 1 | ||
|
||
return itertools.chain(*iter_list) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using yield from
syntax would be much cleaner and would avoid importing itertools
.
@arunkannawadi Gotcha, looking forward to the next release :) |
Fixes #444
Description
This allows
citedby
to return more than 1k citations, bypassing the problem with Google Scholar only display 100 pages.Checklist
develop
and notmain
.If you don't have a premium proxy, some of the tests will be skipped.
The tests that are run should pass without raising
MaxTriesExceededException
or other exceptions.