diff --git a/.github/workflows/python_actions.yml b/.github/workflows/python_actions.yml
index 13ac462..24a0164 100644
--- a/.github/workflows/python_actions.yml
+++ b/.github/workflows/python_actions.yml
@@ -5,7 +5,7 @@ on: [pull_request]
jobs:
build:
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
@@ -50,6 +50,8 @@ jobs:
with:
name: coverage-import
path: .coverage
+ include-hidden-files: true
+ if-no-files-found: error
coveralls:
diff --git a/aip/classic/enforce_schema.py b/aip/classic/enforce_schema.py
index c31b5ac..d0db2dd 100644
--- a/aip/classic/enforce_schema.py
+++ b/aip/classic/enforce_schema.py
@@ -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'):
diff --git a/aip/classic/solr_adapter.py b/aip/classic/solr_adapter.py
index c952c07..4d0f671 100644
--- a/aip/classic/solr_adapter.py
+++ b/aip/classic/solr_adapter.py
@@ -91,6 +91,7 @@ class SolrAdapter(object):
'page_count': 0,
'pub': u'',
'pubnote': [u'',],
+ 'pub_abbrev': u'',
'pub_raw': u'',
'pubdate': u'',
'publisher': u'',
@@ -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')}
diff --git a/tests/classic/test_read_records.py b/tests/classic/test_read_records.py
index c9729b4..6817780 100644
--- a/tests/classic/test_read_records.py
+++ b/tests/classic/test_read_records.py
@@ -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; Bulletin of the American Astronomical Society, Vol. 41, p.187'},
+ 'raw': u'American Astronomical Society, AAS Meeting #213, id.200.06; Bulletin of the American Astronomical Society, Vol. 41, p.187',
+ 'abbreviation': u'Test Pub.'},
'origin': u'AAS',
'page': None,
'page_count': None,
@@ -201,7 +202,8 @@ def test_readRecordsFromADSExports(self):
'electronic_id': None,
'issue': None,
'name': {'canonical': u'Bulletin of the American Astronomical Society',
- 'raw': u'American Astronomical Society, AAS Meeting #213, id.200.06; Bulletin of the American Astronomical Society, Vol. 41, p.187'},
+ 'raw': u'American Astronomical Society, AAS Meeting #213, id.200.06; Bulletin of the American Astronomical Society, Vol. 41, p.187',
+ 'abbreviation': u'Test Pub.'},
'origin': u'AAS',
'page': u'187',
'page_count': None,
diff --git a/tests/classic/test_solr_adapter.py b/tests/classic/test_solr_adapter.py
index 0526af2..2f4b41f 100644
--- a/tests/classic/test_solr_adapter.py
+++ b/tests/classic/test_solr_adapter.py
@@ -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'})
@@ -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"],
diff --git a/tests/stubdata/ADSRecords/2009AAS...21320006C.classic b/tests/stubdata/ADSRecords/2009AAS...21320006C.classic
index fd4f792..8279c5a 100644
--- a/tests/stubdata/ADSRecords/2009AAS...21320006C.classic
+++ b/tests/stubdata/ADSRecords/2009AAS...21320006C.classic
@@ -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; Bulletin of the American Astronomical Society, Vol. 41, p.187'), (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'American Astronomical Society, AAS Meeting #213, id.200.06; 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')]))]))])])]))]))])
\ No newline at end of file
+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; Bulletin of the American Astronomical Society, Vol. 41, p.187'), (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'American Astronomical Society, AAS Meeting #213, id.200.06; 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')]))]))])])]))]))])
\ No newline at end of file
diff --git a/tests/stubdata/ADSRecords/testbibcode b/tests/stubdata/ADSRecords/testbibcode
index 652c31c..5f219f1 100644
--- a/tests/stubdata/ADSRecords/testbibcode
+++ b/tests/stubdata/ADSRecords/testbibcode
@@ -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'}]},
diff --git a/tests/stubdata/ADSRecords/testbibcode2 b/tests/stubdata/ADSRecords/testbibcode2
index d772208..860603c 100644
--- a/tests/stubdata/ADSRecords/testbibcode2
+++ b/tests/stubdata/ADSRecords/testbibcode2
@@ -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",
diff --git a/tests/stubdata/mergerdata.py b/tests/stubdata/mergerdata.py
index 7833aa2..30b4eca 100644
--- a/tests/stubdata/mergerdata.py
+++ b/tests/stubdata/mergerdata.py
@@ -59,6 +59,7 @@
u'American Astronomical Society, AAS Meeting #215, #428.16; Bulletin of the American Astronomical Society, Vol. 42, p.347'),
(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'),
@@ -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; Bulletin of the American Astronomical Society, Vol. 42, p.347'},
+ 'raw': u'American Astronomical Society, AAS Meeting #215, #428.16; Bulletin of the American Astronomical Society, Vol. 42, p.347',
+ 'abbreviation': u'Test Pub.'},
'origin': u'AAS',
'page': None,
'page_count': None,