SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 6513a2c9 authored by Geert Kapteijns's avatar Geert Kapteijns
Browse files

change authorlist to author_list in DOICaller

parent 5bc9296a
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@ class DOICaller:
def _format_data(self):
data = self._crossref_data
pub_title = data['title'][0]
authorlist = ['{} {}'.format(author['given'], author['family']) for author in data['author']]
author_list = ['{} {}'.format(author['given'], author['family']) for author in data['author']]
journal = data['container-title'][0]
volume = data.get('volume', '')
pages = self._get_pages(data)
......@@ -38,7 +38,7 @@ class DOICaller:
self.data = {
'pub_title': pub_title,
'authorlist': authorlist,
'author_list': author_list,
'journal': journal,
'volume': volume,
'pages': pages,
......
......@@ -19,7 +19,6 @@ class ArxivCallerTest(TestCase):
def test_identifier_old_style(self):
caller = ArxivCaller('cond-mat/0612480')
self.assertTrue(caller.is_valid)
print(caller.data)
correct_data = {
'author_list': ['Kouji Ueda', 'Chenglong Jin', 'Naokazu Shibata', 'Yasuhiro Hieida', 'Tomotoshi Nishino'], 'pub_date': datetime.date(2006, 12, 19), 'arxiv_link': 'http://arxiv.org/abs/cond-mat/0612480v2', 'pub_abstract': 'A kind of least action principle is introduced for the discrete time\nevolution of one-dimensional quantum lattice models. Based on this principle,\nwe obtain an optimal condition for the matrix product states on succeeding time\nslices generated by the real-time density matrix renormalization group method.\nThis optimization can also be applied to classical simulations of quantum\ncircuits. We discuss the time reversal symmetry in the fully optimized MPS.', 'pub_title': 'Least Action Principle for the Real-Time Density Matrix Renormalization\n Group'
}
......@@ -37,7 +36,7 @@ class DOICallerTest(TestCase):
'pub_date': '2015-12-18',
'journal': 'Physical Review B',
'pages': '',
'authorlist': [
'author_list': [
'R. Vlijm', 'M. Ganahl', 'D. Fioretto', 'M. Brockmann', 'M. Haque', 'H. G. Evertz', 'J.-S. Caux'],
'volume': '92',
'pub_title': 'Quasi-soliton scattering in quantum spin chains'
......@@ -52,10 +51,10 @@ class DOICallerTest(TestCase):
'journal': 'SciPost Physics',
# Inexplicably, an extra space is added between 'inpenetrable' and 'bosons', but this is a
# Crossref error.
'pub_title': 'One-particle density matrix of trapped one-dimensional impenetrable bosons from conformal invariance',
'pub_title': 'One-particle density matrix of trapped one-dimensional impenetrable bosons from conformal invariance',
'pages': '',
'volume': '2',
'authorlist': ['Yannis Brun', 'Jerome Dubail']
'author_list': ['Yannis Brun', 'Jerome Dubail']
}
self.assertTrue(caller.is_valid)
self.assertEqual(caller.data, correct_data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment