Exemplo n.º 1
0
    def setUp(self):
        self.marcxml = pkg_resources.resource_string('inspire.testsuite',
                                                     os.path.join(
                                                         'fixtures',
                                                         'test_hep_formats.xml')
                                                     )
        record = create_record(self.marcxml)

        self.hep_record = hep.do(record)

        self.bibtex = Bibtex(self.hep_record)

        self.sample_bibtex = {
            'collections': ('article', 'article'),
            'citation_key': 'Aad:2015wqa',
            'author': 'Aad, Georges',
            'title': '\nSearch for supersymmetry in events containing a same-flavour opposite-sign dilepton pair, jets, and large missing transverse momentum in $\sqrt{s}=8$ TeV $pp$ collisions with the ATLAS detector\n',
            'collaboration': 'ATLAS',
            'journal': 'Eur. Phys. J.',
            'volume': 'C75',
            'year': 2015,
            'number': '7',
            'pages': '318',
            'doi': '10.1140/epjc/s10052-015-3661-9, 10.1140/epjc/s10052-015-3518-2',
            'note': '[Erratum: Eur. Phys. J.C75,no.10,463(2015)]',
            'eprint': '1503.03290',
            'archivePrefix': 'arXiv',
            'primaryClass': 'hep-ex',
            'reportNumber': 'CERN-PH-EP-2015-038',
            'SLACcitation': '%%CITATION = ARXIV:1503.03290;%%',

        }
Exemplo n.º 2
0
def convert_marcxml(source):
    """Convert MARC XML to JSON."""
    from dojson.contrib.marc21.utils import create_record, split_blob

    from inspire.dojson.hep import hep
    from inspire.dojson.institutions import institutions
    from inspire.dojson.journals import journals
    from inspire.dojson.experiments import experiments
    from inspire.dojson.hepnames import hepnames
    from inspire.dojson.jobs import jobs
    from inspire.dojson.conferences import conferences

    for data in split_blob(source.read()):
        record = create_record(data)
        if _collection_in_record(record, 'institution'):
            yield institutions.do(record)
        elif _collection_in_record(record, 'experiment'):
            yield experiments.do(record)
        elif _collection_in_record(record, 'journals'):
            yield journals.do(record)
        elif _collection_in_record(record, 'hepnames'):
            yield hepnames.do(record)
        elif _collection_in_record(record, 'job') or \
                _collection_in_record(record, 'jobhidden'):
            yield jobs.do(record)
        elif _collection_in_record(record, 'conferences'):
            yield conferences.do(record)
        else:
            yield hep.do(record)
    def setUp(self):
        self.marcxml = pkg_resources.resource_string('inspire.testsuite',
                                                     os.path.join(
                                                         'fixtures',
                                                         'test_hep_formats.xml')
                                                     )
        record = create_record(self.marcxml)

        self.hep_record = hep.do(record)

        self.sample_cv_latex_html = {
            'title': '\nSearch for supersymmetry in events containing a same-flavour opposite-sign dilepton pair, jets, and large missing transverse momentum in $\sqrt{s}=8$ TeV $pp$ collisions with the ATLAS detector\n',
            'author': 'Georges Aad',
            'arxiv': 'arXiv:1503.03290 [hep-ex]',
            'doi': '10.1140/epjc/s10052-015-3661-9, 10.1140/epjc/s10052-015-3518-2',
            'publi_info': ['Eur.Phys.J. C75 (2015) 7, 318', 'Eur.Phys.J. C75 (2015) 10, 463']

        }

        self.sample_cv_latex_text = {
            'title': '\nSearch for supersymmetry in events containing a same-flavour opposite-sign dilepton pair, jets, and large missing transverse momentum in $\sqrt{s}=8$ TeV $pp$ collisions with the ATLAS detector\n',
            'author': 'Georges Aad',
            'arxiv': 'arXiv:1503.03290 [hep-ex]',
            'doi': '10.1140/epjc/s10052-015-3661-9, 10.1140/epjc/s10052-015-3518-2',
            'publi_info': ['Eur.Phys.J. C75 (2015) 7, 318', 'Eur.Phys.J. C75 (2015) 10, 463']

        }
Exemplo n.º 4
0
    def setUp(self):
        self.marcxml = pkg_resources.resource_string('inspire.testsuite',
                                                     os.path.join(
                                                         'fixtures',
                                                         'test_hep_formats.xml')
                                                     )
        record = create_record(self.marcxml)

        self.hep_record = hep.do(record)

        self.latex_eu = Latex(self.hep_record, 'latex_eu')

        self.latex_us = Latex(self.hep_record, 'latex_us')

        self.sample_latex_eu = {
            'citation_key': 'Aad:2015wqa',
            'author': 'G.~Aad',
            'title': '\nSearch for supersymmetry in events containing a same-flavour opposite-sign dilepton pair, jets, and large missing transverse momentum in $\sqrt{s}=8$ TeV $pp$ collisions with the ATLAS detector\n',
            'publi_info': ['Eur.\ Phys.\ J.\ C {\\bf 75} (2015) 7,  318', '[Eur.\ Phys.\ J.\ C {\\bf 75} (2015) 10,  463]'],
            'arxiv': 'arXiv:1503.03290 [hep-ex]',
            'report_number': '',
            'SLACcitation': '%%CITATION = ARXIV:1503.03290;%%',

        }

        self.sample_latex_us = {
            'citation_key': 'Aad:2015wqa',
            'author': 'G.~Aad',
            'title': '\nSearch for supersymmetry in events containing a same-flavour opposite-sign dilepton pair, jets, and large missing transverse momentum in $\sqrt{s}=8$ TeV $pp$ collisions with the ATLAS detector\n',
            'publi_info': ['Eur.\ Phys.\ J.\ C {\\bf 75}, no. 7, 318 (2015)', '[Eur.\ Phys.\ J.\ C {\\bf 75}, no. 10, 463 (2015)]'],
            'arxiv': 'arXiv:1503.03290 [hep-ex]',
            'report_number': '',
            'SLACcitation': '%%CITATION = ARXIV:1503.03290;%%',

        }
Exemplo n.º 5
0
    def setUp(self):
        self.marcxml = pkg_resources.resource_string('inspire.testsuite',
                                                     os.path.join(
                                                         'fixtures',
                                                         'test_hep_record.xml')
                                                     )
        record = create_record(self.marcxml)

        self.marcxml_to_json = hep.do(record)
        self.json_to_marc = hep2marc.do(self.marcxml_to_json)
Exemplo n.º 6
0
    def setUp(self):
        self.marcxml = pkg_resources.resource_string(
            "inspire.testsuite", os.path.join("fixtures", "test_hep_formats.xml")
        )
        record = create_record(self.marcxml)

        self.hep_record = hep.do(record)

        self.sample_cv_latex = {
            "author": "G.~Aad",
            "title": "{\\bf ``\nSearch for supersymmetry in events containing a same-flavour opposite-sign dilepton pair, jets, and large missing transverse momentum in $\sqrt{s}=8$ TeV $pp$ collisions with the ATLAS detector\n''}",
            "publi_info": [
                "Eur.\ Phys.\ J.\ C {\\bf 75}, no. 7, 318 (2015)",
                "[Eur.\ Phys.\ J.\ C {\\bf 75}, no. 10, 463 (2015)]",
            ],
            "url": cfg["CFG_SITE_URL"] + "/record/1351762",
            "date": "Mar 11, 2015",
        }
Exemplo n.º 7
0
    def setUp(self):
        self.marcxml = pkg_resources.resource_string('inspire.testsuite',
                                                     os.path.join(
                                                         'fixtures',
                                                         'test_hep_formats.xml')
                                                     )
        record = create_record(self.marcxml)

        self.hep_record = hep.do(record)

        self.export = Export(self.hep_record)

        self.sample_export_good = {
            'citation_key': 'Aad:2015wqa',
            'doi': '10.1140/epjc/s10052-015-3661-9, 10.1140/epjc/s10052-015-3518-2',
            'arxiv_field': {u'categories': [u'hep-ex'], u'value': u'arXiv:1503.03290'},
            'arxiv': 'arXiv:1503.03290 [hep-ex]',
            'reportNumber': 'CERN-PH-EP-2015-038',
            'SLACcitation': '%%CITATION = ARXIV:1503.03290;%%',
        }