From 326d39294c71e5ea3dd7e2771e709d44cb7bb521 Mon Sep 17 00:00:00 2001 From: Graeme Watt Date: Wed, 16 Aug 2023 15:47:05 +0100 Subject: [PATCH] Rename 'related_to_hepdata_recids' field * 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. --- .../schemas/1.1.1/additional_info_schema.json | 10 +++++----- hepdata_validator/schemas/1.1.1/submission_schema.json | 10 +++++----- hepdata_validator/version.py | 2 +- testsuite/test_data/TestHEPSubmission/submission.yaml | 2 +- .../invalid_submission_recid.yaml | 2 +- .../valid_submission_related.yaml | 2 +- testsuite/test_submission_validator.py | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/hepdata_validator/schemas/1.1.1/additional_info_schema.json b/hepdata_validator/schemas/1.1.1/additional_info_schema.json index 044ce28..373e73d 100644 --- a/hepdata_validator/schemas/1.1.1/additional_info_schema.json +++ b/hepdata_validator/schemas/1.1.1/additional_info_schema.json @@ -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", @@ -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 diff --git a/hepdata_validator/schemas/1.1.1/submission_schema.json b/hepdata_validator/schemas/1.1.1/submission_schema.json index 59b9a0e..5abf3c2 100644 --- a/hepdata_validator/schemas/1.1.1/submission_schema.json +++ b/hepdata_validator/schemas/1.1.1/submission_schema.json @@ -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": { @@ -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"], diff --git a/hepdata_validator/version.py b/hepdata_validator/version.py index 9f787b7..4185af3 100644 --- a/hepdata_validator/version.py +++ b/hepdata_validator/version.py @@ -27,4 +27,4 @@ from __future__ import absolute_import, print_function -__version__ = "0.3.3" +__version__ = "0.3.4" diff --git a/testsuite/test_data/TestHEPSubmission/submission.yaml b/testsuite/test_data/TestHEPSubmission/submission.yaml index a059188..c0c1079 100644 --- a/testsuite/test_data/TestHEPSubmission/submission.yaml +++ b/testsuite/test_data/TestHEPSubmission/submission.yaml @@ -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 --- diff --git a/testsuite/test_data/TestRelatedSubmissions/invalid_submission_recid.yaml b/testsuite/test_data/TestRelatedSubmissions/invalid_submission_recid.yaml index 1ec1f4f..a97b2ff 100644 --- a/testsuite/test_data/TestRelatedSubmissions/invalid_submission_recid.yaml +++ b/testsuite/test_data/TestRelatedSubmissions/invalid_submission_recid.yaml @@ -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 diff --git a/testsuite/test_data/TestRelatedSubmissions/valid_submission_related.yaml b/testsuite/test_data/TestRelatedSubmissions/valid_submission_related.yaml index d82d698..5a063f0 100644 --- a/testsuite/test_data/TestRelatedSubmissions/valid_submission_related.yaml +++ b/testsuite/test_data/TestRelatedSubmissions/valid_submission_related.yaml @@ -1,6 +1,6 @@ description: "Test Data" comment: Test -related_to_hepdata_recids: +related_to_hepdata_records: - 1 --- name: "Table 1" diff --git a/testsuite/test_submission_validator.py b/testsuite/test_submission_validator.py index 29fdcca..f73ce61 100644 --- a/testsuite/test_submission_validator.py +++ b/testsuite/test_submission_validator.py @@ -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",