Skip to content

Commit

Permalink
Merge pull request #263 from vbalbp/APS-handles-0-pages
Browse files Browse the repository at this point in the history
tohep: remove validating
  • Loading branch information
vbalbp authored Feb 13, 2019
2 parents 2eb2bad + 7f7b62d commit 411e763
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
3 changes: 2 additions & 1 deletion hepcrawl/spiders/aps_spider.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def _parse_json_on_failure(self, failure):

doi = get_value(article, 'identifiers.doi', default='')
record.add_dois(dois_values=[doi])
record.add_value('page_nr', str(article.get('numPages', '')))
if article.get('numPages', -1) > 0:
record.add_value('page_nr', str(article.get('numPages', '')))

record.add_value('abstract', get_value(article, 'abstract.value', default=''))
record.add_value('title', get_value(article, 'title.value', default=''))
Expand Down
8 changes: 1 addition & 7 deletions hepcrawl/tohep.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,7 @@ def hepcrawl_to_hep(crawler_record):
Returns:
dict: The hep formatted (and validated) record.
Raises:
Exception: if there was a validation error (the exact class depends on
:class:`inspire_schemas.api.validate`).
dict: The hep formatted record.
"""

def _filter_affiliation(affiliations):
Expand Down Expand Up @@ -355,6 +351,4 @@ def _filter_affiliation(affiliations):
url=document['url'],
)

builder.validate_record()

return builder.record

0 comments on commit 411e763

Please sign in to comment.