Skip to content

Commit

Permalink
Merge 85458d6 into 8a56cb8
Browse files Browse the repository at this point in the history
  • Loading branch information
ItIsJordan committed Aug 3, 2023
2 parents 8a56cb8 + 85458d6 commit ec3babc
Show file tree
Hide file tree
Showing 16 changed files with 419 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ download them. However, in principle, for testing purposes, note that the same m

.. code:: python
schema_path = 'https://hepdata.net/submission/schemas/1.1.0/'
schema_path = 'https://hepdata.net/submission/schemas/1.1.1/'
schema_name = 'data_schema.json'
and passing a HEPData YAML data file as the ``file_path`` argument of the ``validate`` method.
2 changes: 1 addition & 1 deletion hepdata_validator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

__all__ = ('__version__', )

VALID_SCHEMA_VERSIONS = ['1.1.0', '1.0.1', '1.0.0', '0.1.0']
VALID_SCHEMA_VERSIONS = ['1.1.1', '1.1.0', '1.0.1', '1.0.0', '0.1.0']
LATEST_SCHEMA_VERSION = VALID_SCHEMA_VERSIONS[0]

RAW_SCHEMAS_URL = 'https://raw.githubusercontent.com/HEPData/hepdata-validator/' \
Expand Down
62 changes: 62 additions & 0 deletions hepdata_validator/schemas/1.1.1/additional_info_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://hepdata.net/submission/schemas/1.1.1/additional_info_schema.json",
"title": "Additional information",
"description": "Optional information concerning a whole submission rather than individual data tables",
"type": "object",
"properties": {
"record_ids": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": { "type": [ "string" ] },
"id": { "type": [ "string", "number" ] }
},
"required": [ "type", "id" ],
"additionalProperties": false
}
},
"related_to_hepdata_recids" : {
"type" : "array",
"items" : {"type" : "integer"}
},
"preprintyear": {
"type": "string",
"title": "Preprint Year",
"description": "Indicates the year when the submission preprint was first available.",
"name": "preprintyear"
},
"publicationyear": {
"type": "string",
"title": "Publication Year",
"description": "Indicates the year when the submission publication was available.",
"name": "publicationyear"
},
"dateupdated": {
"type": "string",
"title": "Date Updated",
"description": "Indicates when the submission was last updated.",
"name": "dateupdated"
},
"modifications": {
"type": "array",
"items": {
"type": "object",
"properties": {
"action": { "type": "string" },
"who": { "type": "string" }
},
"required": [ "action", "who" ]
}
},
"additional_resources": {
"$ref": "additional_resources_schema.json"
},
"comment": {
"type": "string",
"description": "Information that applies to all data tables."
}
},
"additionalProperties": true
}
26 changes: 26 additions & 0 deletions hepdata_validator/schemas/1.1.1/additional_resources_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://hepdata.net/submission/schemas/1.1.1/additional_resources_schema.json",
"title": "Additional resources",
"type": "array",
"items": {
"type": "object",
"properties": {
"location": { "type": "string", "maxLength": 256 },
"description": { "type": "string" },
"type": { "type": "string", "maxLength": 64 },
"license": {
"type": "object",
"properties": {
"name": { "type": "string", "maxLength": 256 },
"url": { "type": "string", "maxLength": 256 },
"description": { "type": "string" }
},
"required": [ "name", "url" ],
"additionalProperties": false
}
},
"required": [ "location", "description" ],
"additionalProperties": false
}
}
121 changes: 121 additions & 0 deletions hepdata_validator/schemas/1.1.1/data_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://hepdata.net/submission/schemas/1.1.1/data_schema.json",
"title": "Data table",
"description": "A HEPData table comprising independent_variables and dependent_variables",
"type": "object",
"properties": {
"independent_variables": {
"type": "array",
"items": {
"type": "object",
"properties": {
"header": {
"type": "object",
"properties": {
"name": { "type": "string" },
"units": { "type": "string" }
},
"required": [ "name" ],
"additionalProperties": false
},
"values": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"value": { "type": [ "string", "number" ] }
},
"required": ["value"],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"value": { "type": "number" },
"low": { "type": "number" },
"high": { "type": "number" }
},
"required": ["low", "high"],
"additionalProperties": false
}
]
}
}
},
"required": [ "header", "values" ],
"additionalProperties": false
}
},
"dependent_variables": {
"type": "array",
"items": {
"type": "object",
"properties": {
"header": {
"type": "object",
"properties": {
"name": { "type": "string" },
"units": { "type": "string" }
},
"required": [ "name" ],
"additionalProperties": false
},
"qualifiers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"value": { "type": [ "string", "number" ] },
"units": { "type": "string" }
},
"required": [ "name", "value" ],
"additionalProperties": false
}
},
"values": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": [ "string", "number" ]
},
"errors": {
"type": "array",
"items": {
"type": "object",
"properties": {
"symerror": { "type": [ "number", "string" ] },
"asymerror": {
"type": "object",
"properties": {
"minus": { "type": [ "number", "string" ] },
"plus": { "type": [ "number", "string" ] }
},
"required": [ "minus", "plus" ],
"additionalProperties": false
},
"label": { "type": "string" }
},
"oneOf": [{"required": [ "symerror" ]}, {"required": [ "asymerror" ]}],
"additionalProperties": false
}
}
},
"required": [ "value" ],
"additionalProperties": false
}
}
},
"required": [ "header", "values" ],
"additionalProperties": false
}
}
},
"required": [ "independent_variables", "dependent_variables" ],
"additionalProperties": false
}
55 changes: 55 additions & 0 deletions hepdata_validator/schemas/1.1.1/submission_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://hepdata.net/submission/schemas/1.1.1/submission_schema.json",
"title": "Submission table",
"description": "Metadata for a HEPData table apart from independent_variables and dependent_variables",
"type": "object",
"properties": {
"name": { "type": "string", "maxLength": 64 },
"related_to_table_dois" : {
"type" : "array",
"items" : {"type" : "string", "maxLength" : 128, "pattern" : "^10\\.17182\/hepdata\\.\\d+\\.v\\d+\/t\\d+$" }
},
"location": { "type": "string", "maxLength": 256 },
"description": { "type": "string"},
"keywords": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string", "maxLength": 128, "enum": ["cmenergies", "observables", "reactions", "phrases"] },
"values": {
"type": "array",
"items": { "type": [ "string", "number" ], "maxLength": 128 }
}
},
"required": [ "name", "values" ],
"additionalProperties": false
}
},
"data_file": { "type": "string" },
"data_schema": {
"type": "string",
"description": "Remote location of the JSON schema for the data_file"
},
"data_license": {
"type": "object",
"properties": {
"name": { "type": "string", "maxLength": 256 },
"url": { "type": "string", "maxLength": 256 },
"description": { "type": "string" }
},
"required": [ "name", "url" ],
"additionalProperties": false
},
"additional_resources": {
"$ref": "additional_resources_schema.json"
},
"table_doi": {
"type": "string",
"description": "Present if a user downloads YAML from an existing HEPData record"
}
},
"required": ["name", "description", "keywords", "data_file"],
"additionalProperties": false
}
2 changes: 1 addition & 1 deletion hepdata_validator/schemas/additional_info_schema.json
2 changes: 1 addition & 1 deletion hepdata_validator/schemas/additional_resources_schema.json
2 changes: 1 addition & 1 deletion hepdata_validator/schemas/data_schema.json
2 changes: 1 addition & 1 deletion hepdata_validator/schemas/submission_schema.json
5 changes: 5 additions & 0 deletions testsuite/test_data/TestHEPSubmission/submission.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ comment: | # preserve newlines
- No events with a jet for which ptJet > 25 GeV and |etaJet| < 4.5
- No events with a third lepton for which ptLepton > 10 GeV
- min(DeltaR(l,l)) > 0.3
related_to_hepdata_recids:
- 1

---
# Start a new YAML document to indicate a new data table.
# This is Table 1.
name: "Table 1"
related_to_table_dois:
- "10.17182/hepdata.1.v1/t1"
location: Data from Page 17 of preprint
description: The measured fiducial cross sections. The first systematic uncertainty is the combined systematic uncertainty excluding luminosity, the second is the luminosity
keywords: # used for searching, possibly multiple values for each keyword
Expand Down
58 changes: 58 additions & 0 deletions testsuite/test_data/invalid_submission_doi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
additional_resources: # additional references (e.g. experiment TWiki page for analysis)
- {location: "http://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/PAPERS/STDM-2012-02/", description: "web page with auxiliary material"}

comment: | # preserve newlines
CERN-LHC. Measurements of the cross section for ZZ production using the 4l and 2l2nu decay channels in proton-proton collisions at a centre-of-mass energy of 7 TeV with 4.6 fb^-1 of data collected in 2011. The final states used are 4 electrons, 4 muons, 2 electrons and 2 muons, 2 electrons and missing transverse momentum, and 2 muons and missing transverse momentum (MET).
The cross section values reported in the tables should be multiplied by a factor of 1.0141 to take into account the updated value of the integrated luminosity for the ATLAS 2011 data taking period. The uncertainty on the global normalisation ("Lumi") remains at 1.8%. See Eur.Phys.J. C73 (2013) 2518 for more details.
The 4l channel fiducial region is defined as:
- 4e, 4mu or 2e2mu
- Ambiguities in pairing are resolved by choosing the combination that results in the smaller value of the sum |mll - mZ| for the two pairs, where mll is the mass of the dilepton system.
- ptLepton > 7 GeV (at least one with ptLepton > 20 (25) GeV for muons (electrons))
- |etaLepton| < 3.16
- At least one lepton pair is required to have invariant mass between 66 and 116 GeV. If the second pair also satisfies this, the event is ZZ, otherwise if the second pair satisfies mll > 20 GeV it is ZZ*.
- min(DeltaR(l,l)) > 0.2.
The 2l2nu channel fiducial region is defined as:
- 2e+MET or 2mu+MET
- ptLepton > 20 GeV
- |etaLepton| < 2.5
- mll must be between 76 and 106 GeV
- -MET*cos(phi_METZ)>75 GeV, where phi_METZ is the angle between the Z and the MET
- |MET - pTZ| / pTZ < 0.4, where pTZ is the transverse momentum of the dilepton system
- No events with a jet for which ptJet > 25 GeV and |etaJet| < 4.5
- No events with a third lepton for which ptLepton > 10 GeV
- min(DeltaR(l,l)) > 0.3
---
# Start a new YAML document to indicate a new data table.
# This is Table 1.
name: "Table 1"
related_to_table_dois:
- "10.17182/hepdata.1.v1/t1"
- "10.17182/hepdaata.1.v1/t1"
location: Data from Page 17 of preprint
description: The measured fiducial cross sections. The first systematic uncertainty is the combined systematic uncertainty excluding luminosity, the second is the luminosity
keywords: # used for searching, possibly multiple values for each keyword
- {name: reactions, values: [P P --> Z0 Z0 X]}
- {name: observables, values: [SIG]}
- {name: cmenergies, values: [7000.0]} # centre-of-mass energy in GeV
- {name: phrases, values: [Inclusive, Integrated Cross Section, Cross Section, Proton-Proton Scattering, Z Production, Z pair Production]}
data_file: data1.yaml
data_license: # (optional) you can specify a license for the data
name: "GPL 2"
url: "url for license"
description: "Tell me about it. This can appear in the main record display" # (optional)
additional_resources: # (optional)
- location: "analysis_script.py"
description: "Analysis script"
- location: "http://github.com/HEPData/hepdata"
description: "Full source code for creating this data"
- location: "root_file.root"
description: "Some file"
license: # (optional)
name: 'GPL 2'
url: "url for license"
description: "Tell me about it. This can appear in the main record display" # (optional)
---
Loading

0 comments on commit ec3babc

Please sign in to comment.