Skip to content

Commit

Permalink
Rename 'related_to_hepdata_recids' field
Browse files Browse the repository at this point in the history
* Instead use 'related_to_hepdata_records' (suggested by @20DM).
* Move new fields to end of 'properties' in JSON schema.
* Bump version to 0.3.4 in preparation for new release.
  • Loading branch information
GraemeWatt committed Aug 16, 2023
1 parent f1beb68 commit 326d392
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions hepdata_validator/schemas/1.1.1/additional_info_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
"additionalProperties": false
}
},
"related_to_hepdata_recids" : {
"type" : "array",
"uniqueItems": true,
"items" : {"type" : "integer", "minimum": 1}
},
"preprintyear": {
"type": "string",
"title": "Preprint Year",
Expand Down Expand Up @@ -57,6 +52,11 @@
"comment": {
"type": "string",
"description": "Information that applies to all data tables."
},
"related_to_hepdata_records" : {
"type" : "array",
"uniqueItems": true,
"items" : {"type" : "integer", "minimum": 1}
}
},
"additionalProperties": true
Expand Down
10 changes: 5 additions & 5 deletions hepdata_validator/schemas/1.1.1/submission_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
"type": "object",
"properties": {
"name": { "type": "string", "maxLength": 64 },
"related_to_table_dois" : {
"type" : "array",
"uniqueItems": true,
"items" : {"type" : "string", "maxLength" : 128, "pattern" : "^10\\.17182\/hepdata\\.\\d+\\.v\\d+\/t\\d+$" }
},
"location": { "type": "string", "maxLength": 256 },
"description": { "type": "string"},
"keywords": {
Expand Down Expand Up @@ -49,6 +44,11 @@
"table_doi": {
"type": "string",
"description": "Present if a user downloads YAML from an existing HEPData record"
},
"related_to_table_dois" : {
"type" : "array",
"uniqueItems": true,
"items" : {"type" : "string", "maxLength" : 128, "pattern" : "^10\\.17182\/hepdata\\.\\d+\\.v\\d+\/t\\d+$" }
}
},
"required": ["name", "description", "keywords", "data_file"],
Expand Down
2 changes: 1 addition & 1 deletion hepdata_validator/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@

from __future__ import absolute_import, print_function

__version__ = "0.3.3"
__version__ = "0.3.4"
2 changes: 1 addition & 1 deletion testsuite/test_data/TestHEPSubmission/submission.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ comment: | # preserve newlines
- No events with a third lepton for which ptLepton > 10 GeV
- min(DeltaR(l,l)) > 0.3
related_to_hepdata_recids:
related_to_hepdata_records:
- 1

---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
comment: "Test Text"
related_to_hepdata_recids: ["a", b, 0, 1, 1]
related_to_hepdata_records: ["a", b, 0, 1, 1]
---
name: "Table 1"
description: Words
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
description: "Test Data"
comment: Test
related_to_hepdata_recids:
related_to_hepdata_records:
- 1
---
name: "Table 1"
Expand Down
2 changes: 1 addition & 1 deletion testsuite/test_submission_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ def test_related_submissions(validator_v1, data_path, capsys):
"'a' is not of type 'integer'",
"'b' is not of type 'integer'",
"0 is less than the minimum of 1",
"has non-unique elements in 'related_to_hepdata_recids'"
"has non-unique elements in 'related_to_hepdata_records'"
]},
{
"file": "invalid_submission_doi.yaml",
Expand Down

0 comments on commit 326d392

Please sign in to comment.