Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/python_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [pull_request]
jobs:
build:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -50,6 +50,8 @@ jobs:
with:
name: coverage-import
path: .coverage
include-hidden-files: true
if-no-files-found: error


coveralls:
Expand Down
5 changes: 3 additions & 2 deletions aip/classic/enforce_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,9 @@ def _generalEnforcer(self,block):
r['publication']['altbibcode'] = g('bibcode')
r['publication']['publisher'] = g('publisher')
r['publication']['name'] = {
'raw': g('journal'),
'canonical': g('canonical_journal'),
'raw': g('journal'),
'canonical': g('canonical_journal'),
'abbreviation': g('canonical_journal_abbreviation'),
}

if g('series'):
Expand Down
5 changes: 5 additions & 0 deletions aip/classic/solr_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class SolrAdapter(object):
'page_count': 0,
'pub': u'',
'pubnote': [u'',],
'pub_abbrev': u'',
'pub_raw': u'',
'pubdate': u'',
'publisher': u'',
Expand Down Expand Up @@ -462,6 +463,10 @@ def _page_count(ADS_record):
def _pub(ADS_record):
return {'pub': ADS_record['metadata']['general'].get('publication', {}).get('name', {}).get('canonical')}

@staticmethod
def _pub_abbrev(ADS_record):
return {'pub_abbrev': ADS_record['metadata']['general'].get('publication', {}).get('name', {}).get('abbreviation')}

@staticmethod
def _pub_raw(ADS_record):
return {'pub_raw': ADS_record['metadata']['general'].get('publication', {}).get('name', {}).get('raw')}
Expand Down
6 changes: 4 additions & 2 deletions tests/classic/test_read_records.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def test_readRecordsFromADSExports(self):
'electronic_id': u'200',
'issue': None,
'name': {'canonical': u'American Astronomical Society Meeting Abstracts #213',
'raw': u'American Astronomical Society, AAS Meeting #213, id.200.06; <ALTJOURNAL>Bulletin of the American Astronomical Society, Vol. 41, p.187</ALTJOURNAL>'},
'raw': u'American Astronomical Society, AAS Meeting #213, id.200.06; <ALTJOURNAL>Bulletin of the American Astronomical Society, Vol. 41, p.187</ALTJOURNAL>',
'abbreviation': u'Test Pub.'},
'origin': u'AAS',
'page': None,
'page_count': None,
Expand Down Expand Up @@ -201,7 +202,8 @@ def test_readRecordsFromADSExports(self):
'electronic_id': None,
'issue': None,
'name': {'canonical': u'Bulletin of the American Astronomical Society',
'raw': u'<ALTJOURNAL>American Astronomical Society, AAS Meeting #213, id.200.06</ALTJOURNAL>; Bulletin of the American Astronomical Society, Vol. 41, p.187'},
'raw': u'<ALTJOURNAL>American Astronomical Society, AAS Meeting #213, id.200.06</ALTJOURNAL>; Bulletin of the American Astronomical Society, Vol. 41, p.187',
'abbreviation': u'Test Pub.'},
'origin': u'AAS',
'page': u'187',
'page_count': None,
Expand Down
2 changes: 2 additions & 0 deletions tests/classic/test_solr_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def test_SolrAdapter(self):
'page_count': 0,
'pubdate': u'2013-08-05',
'publisher': u'test-Publisher',
'pub_abbrev': u'Test Pub.',
'title': [u'This is of the title', u'This is of the alternate'],
'volume': u'l24'})

Expand Down Expand Up @@ -124,6 +125,7 @@ def test_SolrAdapter(self):
[u"Kurtz, Michael J.", u"Eichhorn, Guenther", u"Accomazzi, Alberto",
u"Grant, Carolyn S.", u"Murray, Stephen S.", u"Watson, Joyce M."],
"author_count": 6,
"pub_abbrev": u"Test Pub.",
"pub_raw": u"Astronomy and Astrophysics Supplement, v.143, p.41-59",
# "cite_read_boost": 0.45,
"first_author_facet_hier": [u"0/Kurtz, M", u"1/Kurtz, M/Kurtz, Michael J"],
Expand Down
2 changes: 1 addition & 1 deletion tests/stubdata/ADSRecords/2009AAS...21320006C.classic
Original file line number Diff line number Diff line change
@@ -1 +1 @@
OrderedDict([(u'records', OrderedDict([(u'record', OrderedDict([(u'@bibcode', u'2009AAS...21320006C'), (u'@entry_date', u'2009-01-03'), (u'metadata', [OrderedDict([(u'@origin', u'AAS'), (u'@type', u'general'), (u'@primary', u'True'), (u'@alternate_journal', u'False'), (u'creation_time', u'2016-01-21T23:19:13Z'), (u'modification_time', u'2016-01-21T23:19:13Z'), (u'bibcode', u'2009AAS...21320006C'), (u'dates', OrderedDict([(u'date', OrderedDict([(u'@type', u'date-published'), ('#text', u'2009-01-00')]))])), (u'publication_year', u'2009'), (u'publisher', u'Publisher'), (u'title', u"A New Way of Looking: the Amateur Telescope Making Movement in 1920's America"), (u'abstract', u'The hobby of astronomy in America was restricted largely to a relatively few well-off persons prior to the 1920\'s in part due to the difficulty in acquiring adequate instruments. Even modest telescopes were quite expensive and very few in number. The standard "beginner\'s\u201d instrument was a three-inch diameter refracting telescope, precision crafted by expert manufacturers. Early Twentieth-century astronomy popularizers recognized the problem of availability of instruments and saw that this hindered growth of the hobby. The idea of making one\'s own telescope was limited to a hardy few with the time, equipment, machining skills, and information required and very few attempted the task. This situation changed dramatically by the late 1920\'s due to the publication of a series of articles in Scientific American that provided detailed, practical instructions for a six-inch Newtonian reflecting telescope, a project well within the means and skills of the average "handyman". Publication of these articles initiated a profound change in perception for amateur astronomers, who quickly became amateur telescope makers as well, creating precision instruments for themselves and in part leading to a widening of the amateur astronomy hobby and interest in astronomy generally. This paper forms a portion of a doctoral dissertation being written by the author.'), (u'author', OrderedDict([(u'@nr', u'1'), (u'name', OrderedDict([(u'western', u'Cameron, Gary L.'), (u'normalized', u'Cameron, G')])), (u'affiliations', OrderedDict([(u'affiliation', u'Iowa State University')])), (u'type', u'regular')])), (u'ADSaffiliation', u'AA(Iowa State University)'), (u'journal', u'American Astronomical Society, AAS Meeting #213, id.200.06; <ALTJOURNAL>Bulletin of the American Astronomical Society, Vol. 41, p.187</ALTJOURNAL>'), (u'canonical_journal', u'American Astronomical Society Meeting Abstracts #213'), (u'electronic_id', u'200'), (u'volume', u'213')]), OrderedDict([(u'@origin', u'AAS'), (u'@type', u'general'), (u'@primary', u'False'), (u'@alternate_journal', u'True'), (u'creation_time', u'2016-01-21T23:20:41Z'), (u'modification_time', u'2016-01-21T23:20:41Z'), (u'bibcode', u'2009BAAS...41..187C'), (u'dates', OrderedDict([(u'date', OrderedDict([(u'@type', u'date-published'), ('#text', u'2009-01-00')]))])), (u'publication_year', u'2009'), (u'title', u"A New Way of Looking: the Amateur Telescope Making Movement in 1920's America"), (u'author', OrderedDict([(u'@nr', u'1'), (u'name', OrderedDict([(u'western', u'Cameron, Gary L.'), (u'normalized', u'Cameron, G')])), (u'affiliations', OrderedDict([(u'affiliation', u'Iowa State University')])), (u'type', u'regular')])), (u'ADSaffiliation', u'AA(Iowa State University)'), (u'journal', u'<ALTJOURNAL>American Astronomical Society, AAS Meeting #213, id.200.06</ALTJOURNAL>; Bulletin of the American Astronomical Society, Vol. 41, p.187'), (u'volume', u'41'), (u'page_range', u'187'), (u'canonical_journal', u'Bulletin of the American Astronomical Society'), (u'page', u'187')]), OrderedDict([(u'@origin', u'ADS metadata'), (u'@type', u'properties'), (u'@primary', u'False'), (u'@alternate_journal', u'False'), (u'JSON_timestamp', u'{"abs":[{"p":"/proj/ads/abstracts/ast/text/J39/J39-71877.abs","primary":1,"t":"1453418353"},{"a":"2009BAAS...41..187C","p":"/proj/ads/abstracts/ast/text/S39/S39-71877.abs","t":"1453418441"}],"prop":["book","nonarticle","toc"]}'), (u'databases', OrderedDict([(u'database', u'AST')])), (u'pubtype', u'abstract'), (u'private', u'0'), (u'ocrabstract', u'0'), (u'preprint', None), (u'nonarticle', u'1'), (u'refereed', u'0'), (u'openaccess', u'0'), (u'eprint_openaccess', u'0'), (u'pub_openaccess', u'0'), (u'ads_openaccess', u'0'), (u'toc', u'1')]), OrderedDict([(u'@origin', u'ADS metadata'), (u'@type', u'relations'), (u'@primary', u'False'), (u'@alternate_journal', u'False'), (u'alternates', OrderedDict([(u'alternate', OrderedDict([(u'@type', u'alternate'), ('#text', u'2009BAAS...41..187C')]))])), (u'identifiers', OrderedDict([(u'identifier', OrderedDict([(u'@type', u'identifier'),('#text', u'2009AAS...21320006C')]))])), (u'links', OrderedDict([(u'link', OrderedDict([(u'@url', u'http://adsabs.harvard.edu/abs/2009AAS...21320006C'), (u'@type', u'ADSlink')]))]))])])]))]))])
OrderedDict([(u'records', OrderedDict([(u'record', OrderedDict([(u'@bibcode', u'2009AAS...21320006C'), (u'@entry_date', u'2009-01-03'), (u'metadata', [OrderedDict([(u'@origin', u'AAS'), (u'@type', u'general'), (u'@primary', u'True'), (u'@alternate_journal', u'False'), (u'creation_time', u'2016-01-21T23:19:13Z'), (u'modification_time', u'2016-01-21T23:19:13Z'), (u'bibcode', u'2009AAS...21320006C'), (u'dates', OrderedDict([(u'date', OrderedDict([(u'@type', u'date-published'), ('#text', u'2009-01-00')]))])), (u'publication_year', u'2009'), (u'publisher', u'Publisher'), (u'title', u"A New Way of Looking: the Amateur Telescope Making Movement in 1920's America"), (u'abstract', u'The hobby of astronomy in America was restricted largely to a relatively few well-off persons prior to the 1920\'s in part due to the difficulty in acquiring adequate instruments. Even modest telescopes were quite expensive and very few in number. The standard "beginner\'s\u201d instrument was a three-inch diameter refracting telescope, precision crafted by expert manufacturers. Early Twentieth-century astronomy popularizers recognized the problem of availability of instruments and saw that this hindered growth of the hobby. The idea of making one\'s own telescope was limited to a hardy few with the time, equipment, machining skills, and information required and very few attempted the task. This situation changed dramatically by the late 1920\'s due to the publication of a series of articles in Scientific American that provided detailed, practical instructions for a six-inch Newtonian reflecting telescope, a project well within the means and skills of the average "handyman". Publication of these articles initiated a profound change in perception for amateur astronomers, who quickly became amateur telescope makers as well, creating precision instruments for themselves and in part leading to a widening of the amateur astronomy hobby and interest in astronomy generally. This paper forms a portion of a doctoral dissertation being written by the author.'), (u'author', OrderedDict([(u'@nr', u'1'), (u'name', OrderedDict([(u'western', u'Cameron, Gary L.'), (u'normalized', u'Cameron, G')])), (u'affiliations', OrderedDict([(u'affiliation', u'Iowa State University')])), (u'type', u'regular')])), (u'ADSaffiliation', u'AA(Iowa State University)'), (u'journal', u'American Astronomical Society, AAS Meeting #213, id.200.06; <ALTJOURNAL>Bulletin of the American Astronomical Society, Vol. 41, p.187</ALTJOURNAL>'), (u'canonical_journal_abbreviation', u'Test Pub.'), (u'canonical_journal', u'American Astronomical Society Meeting Abstracts #213'), (u'electronic_id', u'200'), (u'volume', u'213')]), OrderedDict([(u'@origin', u'AAS'), (u'@type', u'general'), (u'@primary', u'False'), (u'@alternate_journal', u'True'), (u'creation_time', u'2016-01-21T23:20:41Z'), (u'modification_time', u'2016-01-21T23:20:41Z'), (u'bibcode', u'2009BAAS...41..187C'), (u'dates', OrderedDict([(u'date', OrderedDict([(u'@type', u'date-published'), ('#text', u'2009-01-00')]))])), (u'publication_year', u'2009'), (u'title', u"A New Way of Looking: the Amateur Telescope Making Movement in 1920's America"), (u'author', OrderedDict([(u'@nr', u'1'), (u'name', OrderedDict([(u'western', u'Cameron, Gary L.'), (u'normalized', u'Cameron, G')])), (u'affiliations', OrderedDict([(u'affiliation', u'Iowa State University')])), (u'type', u'regular')])), (u'ADSaffiliation', u'AA(Iowa State University)'), (u'journal', u'<ALTJOURNAL>American Astronomical Society, AAS Meeting #213, id.200.06</ALTJOURNAL>; Bulletin of the American Astronomical Society, Vol. 41, p.187'), (u'volume', u'41'), (u'page_range', u'187'), (u'canonical_journal_abbreviation', u'Test Pub.'), (u'canonical_journal', u'Bulletin of the American Astronomical Society'), (u'page', u'187')]), OrderedDict([(u'@origin', u'ADS metadata'), (u'@type', u'properties'), (u'@primary', u'False'), (u'@alternate_journal', u'False'), (u'JSON_timestamp', u'{"abs":[{"p":"/proj/ads/abstracts/ast/text/J39/J39-71877.abs","primary":1,"t":"1453418353"},{"a":"2009BAAS...41..187C","p":"/proj/ads/abstracts/ast/text/S39/S39-71877.abs","t":"1453418441"}],"prop":["book","nonarticle","toc"]}'), (u'databases', OrderedDict([(u'database', u'AST')])), (u'pubtype', u'abstract'), (u'private', u'0'), (u'ocrabstract', u'0'), (u'preprint', None), (u'nonarticle', u'1'), (u'refereed', u'0'), (u'openaccess', u'0'), (u'eprint_openaccess', u'0'), (u'pub_openaccess', u'0'), (u'ads_openaccess', u'0'), (u'toc', u'1')]), OrderedDict([(u'@origin', u'ADS metadata'), (u'@type', u'relations'), (u'@primary', u'False'), (u'@alternate_journal', u'False'), (u'alternates', OrderedDict([(u'alternate', OrderedDict([(u'@type', u'alternate'), ('#text', u'2009BAAS...41..187C')]))])), (u'identifiers', OrderedDict([(u'identifier', OrderedDict([(u'@type', u'identifier'),('#text', u'2009AAS...21320006C')]))])), (u'links', OrderedDict([(u'link', OrderedDict([(u'@url', u'http://adsabs.harvard.edu/abs/2009AAS...21320006C'), (u'@type', u'ADSlink')]))]))])])]))]))])
2 changes: 2 additions & 0 deletions tests/stubdata/ADSRecords/testbibcode
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
'page': u'2056-2078',
'page_count': 0,
'publisher': u'test-Publisher',
"name" : {
'abbreviation': u'Test Pub.',},
'volume': u'l24'},
'titles': [{'lang': u'en', 'text': u'This is of the title'},
{'lang': '', 'text': u'This is of the alternate'}]},
Expand Down
3 changes: 2 additions & 1 deletion tests/stubdata/ADSRecords/testbibcode2
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
],
"name" : {
"raw" : u"Astronomy and Astrophysics Supplement, v.143, p.41-59",
"canonical" : u"Astronomy and Astrophysics Supplement Series"
"canonical" : u"Astronomy and Astrophysics Supplement Series",
"abbreviation" : u"Test Pub.",
},
"page_count" : u"19",
"page" : u"41",
Expand Down
4 changes: 3 additions & 1 deletion tests/stubdata/mergerdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
u'American Astronomical Society, AAS Meeting #215, #428.16; <ALTJOURNAL>Bulletin of the American Astronomical Society, Vol. 42, p.347</ALTJOURNAL>'),
(u'canonical_journal',
u'American Astronomical Society Meeting Abstracts #215'),
(u'canonical_journal_abbreviation', u'Test Pub.'),
(u'electronic_id', u'428.16'),
(u'publication_year', u'2010'),
(u'volume', u'215'),
Expand Down Expand Up @@ -257,7 +258,8 @@
'electronic_id': u'428.16',
'issue': None,
'name': {'canonical': u'American Astronomical Society Meeting Abstracts #215',
'raw': u'American Astronomical Society, AAS Meeting #215, #428.16; <ALTJOURNAL>Bulletin of the American Astronomical Society, Vol. 42, p.347</ALTJOURNAL>'},
'raw': u'American Astronomical Society, AAS Meeting #215, #428.16; <ALTJOURNAL>Bulletin of the American Astronomical Society, Vol. 42, p.347</ALTJOURNAL>',
'abbreviation': u'Test Pub.'},
'origin': u'AAS',
'page': None,
'page_count': None,
Expand Down