Skip to content

Commit

Permalink
Merge pull request #288 from mugdhapolimera/publisheredit
Browse files Browse the repository at this point in the history
Publisher field assigned for records with metadata from multiple sources
  • Loading branch information
mugdhapolimera authored Feb 8, 2024
2 parents e13f0f5 + 1e60945 commit fdc613f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions aip/classic/merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def publicationMerger(self,field):
'electronic_id': i['publication']['electronic_id'],
'name': i['publication']['name'],
'dates': i['publication']['dates'],
'publisher': i['publication']['publisher'],
},i['tempdata']) for i in self.blocks if not i['tempdata']['alternate_journal'] ]

altpublications = [{
Expand All @@ -204,6 +205,7 @@ def publicationMerger(self,field):
'electronic_id': i['publication']['electronic_id'],
'name': i['publication']['name'],
'dates': i['publication']['dates'],
'publisher': i['publication']['publisher'],
} for i in self.blocks if i['tempdata']['alternate_journal'] ]

self.altpublications = altpublications
Expand Down
1 change: 0 additions & 1 deletion aip/classic/solr_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import re
import traceback
import datetime

from adsputils import get_date, date2solrstamp
from aip.classic import enforce_schema

Expand Down
2 changes: 1 addition & 1 deletion tests/classic/test_solr_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_SolrAdapter(self):
'publisher': u'test-Publisher',
'title': [u'This is of the title', u'This is of the alternate'],
'volume': u'l24'})

r = solr_adapter.SolrAdapter.adapt(ADSRECORDS['testbibcode2'])
solr_adapter.SolrAdapter.validate(r) #Raises AssertionError if not validated
self.assertEquals(r, {
Expand Down
3 changes: 3 additions & 0 deletions tests/stubdata/ADSRecords/2015ApJ...815..133S
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
'page_last': None,
'page_range': None,
'volume': u'815',
'publisher': u'IOP',
'series': u'123'},
'pubnote': [],
'tempdata': {'alternate_journal': False,
Expand Down Expand Up @@ -130,6 +131,7 @@
'page_last': None,
'page_range': None,
'volume': u'815',
'publisher': u'Publisher',
'series': u'123'},
'pubnote': [],
'tempdata': {'alternate_journal': False,
Expand Down Expand Up @@ -715,6 +717,7 @@
'page_last': None,
'page_range': None,
'volume': None,
'publisher': u'Publisher',
'series': u'123'},
'pubnote': [OrderedDict([(u'@origin', u'ARXIV'), ('content', u'33 pages, 7 figures, 5 tables, ApJ in press; doi:10.1088/0004-637X/815/2/133')])],
'tempdata': {'alternate_journal': True,
Expand Down
1 change: 1 addition & 0 deletions tests/stubdata/mergerdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,5 +515,6 @@
'pubnote': [u'33 pages, 7 figures, 5 tables, ApJ in press; doi:10.1088/0004-637X/815/2/133'],
'title': [u'Ultraviolet Radiative Transfer Modeling of Nearby Galaxies with Extraplanar Dusts'],
'volume': u'815',
'publisher': u'IOP',
'series': '123',
'year': u'2015'}

0 comments on commit fdc613f

Please sign in to comment.