-
Notifications
You must be signed in to change notification settings - Fork 133
WIP: Scival Publication Lookup #377
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
base: master
Are you sure you want to change the base?
Conversation
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 extremely solid work, thank you very much! It took me a while to review your elaborated PR, but only because I wanted to give it the attention it deserves! I have just a few requests for more documentation.
Awesome work @montypanday ! I'm sure many people will find this utterly useful! I've got a question: None of the SciVal APIs has views, right? |
Hi @Michael-E-Rose, Thank you for your feedback. I have made the requested changes.
With this change adding a Lookup class for the following API's should be fairly simple. SciVal Author Lookup My apologies for the delay in response. Kind regards |
views = VIEWS.get(api, []) | ||
if views: | ||
for view in views: | ||
(base_dir / view).mkdir(parents=True, exist_ok=True) | ||
else: | ||
base_dir.mkdir(parents=True, exist_ok=True) |
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.
We can simplify this. The test is not necessary because the loop doesn't trigger for an empty list. But in this case we need the base_path to be triggered. We achieve that with
views = VIEWS.get(api, [""]) # empty string
for view in views:
cache_folder = path / view
cache_folder.mkdir(parent=True, exist_ok=True)
def test_publication_id(): | ||
assert pub1.id == 85036568406 | ||
|
||
|
||
def test_publication_doi(): | ||
assert pub1.doi == "10.1002/anie.201709271" | ||
|
||
|
||
def test_publication_type(): | ||
assert pub1.type == "Article" | ||
|
||
|
||
def test_publication_year(): | ||
assert pub1.publication_year == 2017 | ||
|
||
|
||
def test_publication_source_title(): | ||
assert pub1.source_title == 'Angewandte Chemie - International Edition' | ||
|
||
|
||
def test_publication_citation_count(): | ||
assert pub1.citation_count > 0 | ||
|
||
|
||
def test_publication_authors_count(): | ||
assert len(pub1.authors) >= 7 | ||
|
||
|
||
def test_publication_first_author(): | ||
assert pub1.authors[0].id == 7404861905 | ||
assert pub1.authors[0].name == "Lin, T.-E." | ||
|
||
|
||
def test_publication_institutions_count(): | ||
assert len(pub1.institutions) >= 3 | ||
|
||
|
||
def test_publication_first_institution(): | ||
assert pub1.institutions[0].id == 217002 | ||
assert pub1.institutions[0].name == "Chang Gung University" | ||
assert pub1.institutions[0].country == "Taiwan" | ||
assert pub1.institutions[0].country_code == "TWN" | ||
|
||
|
||
def test_publication_sdgs(): | ||
assert len(pub1.sdgs) >= 1 | ||
assert pub1.sdgs[0] == 'SDG 3: Good Health and Well-being' |
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.
Would you mind sorting them alphabetically, please?
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.
Great! Almost there. I am just asking for two changes.
Once you feel you are done, please remove the WIP from the PR title. Otherwise I cannot merge.
Implemented the new Scival submodule with 1 function Publication lookup
Have added tests to test the properties
Uses the utils and superclasses
Given the list of Scival API's here - https://dev.elsevier.com/api_docs.html
I would appreciate some feedback on the naming of classes so I can improve the PR.
I plan to build all of the functions available, Proposing this PR for early feedback.
Happy to amend this PR based on feedback.
Your help on this request is much appreciated.
Linked to #203 #253