Skip to content

Commit

Permalink
global: fix data references
Browse files Browse the repository at this point in the history
  • Loading branch information
drjova committed Nov 28, 2024
1 parent 4e72fe2 commit 8b4e6b2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 40 deletions.
1 change: 1 addition & 0 deletions inspire_schemas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@
"seminars",
"jobs",
"journals",
"data",
]


Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def _generate_json_schemas():
]

docs_require = [
'jsonschema2rst>=0.1.6',
'jsonschema2rst>=0.1.7',
'Sphinx',
]

Expand Down
79 changes: 40 additions & 39 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1414,49 +1414,50 @@ def test_code_to_name_respects_overrides():

def test_get_references_for_schema_returns_proper_schemas():
expected = {
u"experiments": [
("hep", u"collaborations.record.$ref"),
("hep", u"accelerator_experiments.record.$ref"),
("authors", u"project_membership.record.$ref"),
("experiments", u"accelerator.record.$ref"),
("experiments", u"related_records.record.$ref"),
("experiments", u"collaboration.record.$ref"),
("jobs", u"accelerator_experiments.record.$ref"),
"experiments": [
("hep", "accelerator_experiments.record.$ref"),
("hep", "collaborations.record.$ref"),
("authors", "project_membership.record.$ref"),
("experiments", "accelerator.record.$ref"),
("experiments", "collaboration.record.$ref"),
("experiments", "related_records.record.$ref"),
("jobs", "accelerator_experiments.record.$ref"),
("data", "accelerator_experiments.record.$ref"),
("data", "collaborations.record.$ref"),
],
u"hep": [
("data", u"literature.record.$ref"),
("hep", u"references.record.$ref"),
("hep", u"publication_info.parent_record.$ref"),
("hep", u"related_records.record.$ref"),
("seminars", u"literature_records.record.$ref"),
"institutions": [
("hep", "authors.affiliations.record.$ref"),
("hep", "record_affiliations.record.$ref"),
("hep", "thesis_info.institutions.record.$ref"),
("authors", "positions.record.$ref"),
("experiments", "institutions.record.$ref"),
("institutions", "related_records.record.$ref"),
("seminars", "speakers.affiliations.record.$ref"),
("jobs", "institutions.record.$ref"),
("data", "authors.affiliations.record.$ref"),
],
u"conferences": [("hep", u"publication_info.conference_record.$ref")],
u"authors": [
("hep", u"authors.record.$ref"),
("authors", u"advisors.record.$ref"),
("conferences", u"contact_details.record.$ref"),
("seminars", u"speakers.record.$ref"),
("seminars", u"contact_details.record.$ref"),
("jobs", u"contact_details.record.$ref"),
"authors": [
("hep", "authors.record.$ref"),
("authors", "advisors.record.$ref"),
("conferences", "contact_details.record.$ref"),
("seminars", "contact_details.record.$ref"),
("seminars", "speakers.record.$ref"),
("jobs", "contact_details.record.$ref"),
("data", "authors.record.$ref"),
],
u'data': [
('hep', u'references.record.$ref'),
('hep', u'data.record.$ref'),
"data": [("hep", "data.record.$ref"), ("hep", "references.record.$ref")],
"conferences": [("hep", "publication_info.conference_record.$ref")],
"journals": [
("hep", "publication_info.journal_record.$ref"),
("hep", "references.reference.publication_info.journal_record.$ref"),
("journals", "related_records.record.$ref"),
],
u"journals": [
("hep", u"publication_info.journal_record.$ref"),
('hep', u'references.reference.publication_info.journal_record.$ref'),
("journals", u"related_records.record.$ref"),
],
u"institutions": [
("hep", u"thesis_info.institutions.record.$ref"),
("hep", u"authors.affiliations.record.$ref"),
("hep", u"record_affiliations.record.$ref"),
("authors", u"positions.record.$ref"),
("experiments", u"institutions.record.$ref"),
("institutions", u"related_records.record.$ref"),
("seminars", u"speakers.affiliations.record.$ref"),
("jobs", u"institutions.record.$ref"),
"hep": [
("hep", "publication_info.parent_record.$ref"),
("hep", "references.record.$ref"),
("hep", "related_records.record.$ref"),
("seminars", "literature_records.record.$ref"),
("data", "literature.record.$ref"),
],
}

Expand Down

0 comments on commit 8b4e6b2

Please sign in to comment.