From 9a1a72e6348dded7b9c56ff4bfd08a842cdc460c Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Fri, 8 Dec 2023 09:59:33 +0100 Subject: [PATCH 1/5] initial chat with Carsten --- src/pyhf/schemas/1.1.0/defs.json | 333 ++++++++++++++++++++++++ src/pyhf/schemas/1.1.0/jsonpatch.json | 5 + src/pyhf/schemas/1.1.0/measurement.json | 5 + src/pyhf/schemas/1.1.0/model.json | 5 + src/pyhf/schemas/1.1.0/patchset.json | 5 + src/pyhf/schemas/1.1.0/workspace.json | 5 + 6 files changed, 358 insertions(+) create mode 100644 src/pyhf/schemas/1.1.0/defs.json create mode 100644 src/pyhf/schemas/1.1.0/jsonpatch.json create mode 100644 src/pyhf/schemas/1.1.0/measurement.json create mode 100644 src/pyhf/schemas/1.1.0/model.json create mode 100644 src/pyhf/schemas/1.1.0/patchset.json create mode 100644 src/pyhf/schemas/1.1.0/workspace.json diff --git a/src/pyhf/schemas/1.1.0/defs.json b/src/pyhf/schemas/1.1.0/defs.json new file mode 100644 index 0000000000..ac06cc0a8f --- /dev/null +++ b/src/pyhf/schemas/1.1.0/defs.json @@ -0,0 +1,333 @@ +{ + "$schema": "http://json-schema.org/draft/2020-12/schema#", + "$id": "https://scikit-hep.org/pyhf/schemas/1.1.0/defs.json", + "definitions": { + "workspace": { + "type": "object", + "properties": { + "distributions": { "type": "array", "items": {"$ref": "#/definitions/distribution"}, "minItems": 1 }, + "measurements": { "type": "array", "items": {"$ref": "#/definitions/measurement"}, "minItems": 1 }, + "observations": { "type": "array", "items": {"$ref": "#/definitions/observation" }, "minItems": 1 }, + "type": { "const": "histfactory_dist" }, + "version": { "const": "1.1.0" } + }, + "additionalProperties": false, + "required": ["distributions", "measurements", "observations", "version"] + }, + "model": { + "type": "object", + "properties": { + "channels": { "type": "array", "items": {"$ref": "#/definitions/distribution"}, "minItems": 1 }, + "parameters": { "type": "array", "items": {"$ref": "#/definitions/parameter"} } + }, + "additionalProperties": false, + "required": ["channels"] + }, + "observation": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "data": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + }, + "required": ["name", "data"], + "additionalProperties": false + }, + "measurement": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "config": { "$ref": "#/definitions/config" } + }, + "required": ["name", "config"], + "additionalProperties": false + }, + "config": { + "type": "object", + "properties": { + "poi": { "type" : "string" }, + "parameters": { "type": "array", "items": {"$ref": "#/definitions/parameter"} } + }, + "required": ["poi", "parameters"], + "additionalProperties": false + }, + "parameter": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "inits": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, + "bounds": { "type": "array", "items": {"type": "array", "items": {"type": "number", "minItems": 2, "maxItems": 2}}, "minItems": 1 }, + "auxdata": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, + "factors": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, + "sigmas": { "type": "array", "items": {"type": "number"}, "minItems": 1}, + "fixed": { "type": "boolean" } + }, + "required": ["name"], + "additionalProperties": false + }, + "distribution": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "samples": { "type": "array", "items": {"$ref": "#/definitions/sample"}, "minItems": 1 }, + "axes": { "type": "array", "items": {"$ref": "#/definitions/axis"}, "minItems": 1, "maxItems": 1} + }, + "required": ["name", "samples"], + "additionalProperties": false + }, + "axis": { + "type": "object", + "MAKE THIS ONEOF": "", + "(A)": "", + "properties_oneof": { + "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, + "max": { "type": "number" }, + "min": { "type": "number" }, + "nbins": { "type": "number" } + }, + "(B)": "", + "properties": { + "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, + "edges": { "type": "array", "items": { "type": "number", "minItems": 2 } } + } + }, + "sample": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "data": { "type": "object", "properties": { "contents": { "type": "array", "items": {"type": "number"}, "minItems": 1 }} }, + "modifiers": { + "type": "array", + "items": { + "anyOf": [ + { "$ref": "#/definitions/modifier/histosys" }, + { "$ref": "#/definitions/modifier/lumi" }, + { "$ref": "#/definitions/modifier/normfactor" }, + { "$ref": "#/definitions/modifier/normsys" }, + { "$ref": "#/definitions/modifier/shapefactor" }, + { "$ref": "#/definitions/modifier/shapesys" }, + { "$ref": "#/definitions/modifier/staterror" } + ] + } + } + }, + "required": ["name", "data", "modifiers"], + "additionalProperties": false + }, + "modifier": { + "histosys": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "type": { "const": "histosys" }, + "data": { + "type": "object", + "properties": { + "lo_data": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, + "hi_data": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + }, + "required": ["lo_data", "hi_data"], + "additionalProperties": false + } + }, + "required": ["name", "type", "data"], + "additionalProperties": false + }, + "lumi": { + "type": "object", + "properties": { + "name": { "const": "lumi" }, + "type": { "const": "lumi" }, + "data": { "type": "null" } + }, + "required": ["name", "type", "data"], + "additionalProperties": false + }, + "normfactor": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "type": { "const": "normfactor" }, + "data": { "type": "null" } + }, + "required": ["name", "type", "data"], + "additionalProperties": false + }, + "normsys": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "type": { "const": "normsys" }, + "data": { + "type": "object", + "properties": { + "lo": { "type": "number" }, + "hi": { "type": "number"} + }, + "required": ["lo", "hi"], + "additionalProperties": false + } + }, + "required": ["name", "type", "data"], + "additionalProperties": false + }, + "shapefactor": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "type": { "const": "shapefactor" }, + "data": { "type": "null" } + }, + "required": ["name", "type", "data"], + "additionalProperties": false + }, + "shapesys": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "type": { "const": "shapesys" }, + "data": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + }, + "required": ["name", "type", "data"], + "additionalProperties": false + }, + "staterror": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "type": { "const": "staterror" }, + "data": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + }, + "required": ["name", "type", "data"], + "additionalProperties": false + } + }, + "jsonpatch": { + "description": "an array of patch operations (copied from http://json.schemastore.org/json-patch)", + "type": "array", + "items": { + "$ref": "#/definitions/jsonpatch/operation" + }, + "operation": { + "type": "object", + "required": [ "op", "path" ], + "allOf": [ { "$ref": "#/definitions/jsonpatch/path" } ], + "oneOf": [ + { + "required": [ "value" ], + "properties": { + "op": { + "description": "The operation to perform.", + "type": "string", + "enum": [ "add", "replace", "test" ] + }, + "value": { + "description": "The value to add, replace or test." + } + } + }, + { + "properties": { + "op": { + "description": "The operation to perform.", + "type": "string", + "enum": [ "remove" ] + } + } + }, + { + "required": [ "from" ], + "properties": { + "op": { + "description": "The operation to perform.", + "type": "string", + "enum": [ "move", "copy" ] + }, + "from": { + "description": "A JSON Pointer path pointing to the location to move/copy from.", + "type": "string" + } + } + } + ] + }, + "path": { + "properties": { + "path": { + "description": "A JSON Pointer path.", + "type": "string" + } + } + } + }, + "patchset": { + "description": "A set of JSONPatch patches which modify a pyhf workspace", + "type": "object", + "properties": { + "patches": { "$ref": "#/definitions/patchset/patches" }, + "metadata": { "$ref": "#/definitions/patchset/metadata" }, + "version": { "const": "1.1.0" } + }, + "additionalProperties": false, + "required": ["patches", "metadata", "version"], + "references": { + "type": "object", + "properties": { + "hepdata": { "type": "string", "pattern": "^ins[0-9]{7}$" } + }, + "additionalProperties": false, + "minProperties": 1 + }, + "digests": { + "type": "object", + "properties": { + "md5": { "type": "string", "pattern": "^[a-f0-9]{32}$" }, + "sha256": { "type": "string", "pattern": "^[a-fA-F0-9]{64}$" } + }, + "additionalProperties": false, + "minProperties": 1 + }, + "patches": { + "type": "array", + "items": { "$ref": "#/definitions/patchset/patch" }, + "minItems": 1 + }, + "patch": { + "type": "object", + "properties": { + "patch": { "$ref": "#/definitions/jsonpatch" }, + "metadata": { + "type": "object", + "properties": { + "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, + "values": { + "type": "array", + "items": { + "anyOf": [{"type": "number"}, {"type": "string"}] + } + } + }, + "required": ["name", "values"], + "additionalProperties": true + } + }, + "required": ["metadata", "patch"], + "additionalProperties": false + }, + "metadata": { + "type": "object", + "properties": { + "digests": { "$ref": "#/definitions/patchset/digests" }, + "labels": { + "type": "array", + "items": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, + "minItems": 1 + }, + "description": { "type": "string" }, + "references": { "$ref": "#/definitions/patchset/references" } + }, + "required": ["references", "digests", "labels", "description"], + "additionalProperties": true + } + } + } +} diff --git a/src/pyhf/schemas/1.1.0/jsonpatch.json b/src/pyhf/schemas/1.1.0/jsonpatch.json new file mode 100644 index 0000000000..93b7aba6b0 --- /dev/null +++ b/src/pyhf/schemas/1.1.0/jsonpatch.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft/2020-12/schema#", + "$id": "https://scikit-hep.org/pyhf/schemas/1.1.0/jsonpatch.json", + "$ref": "defs.json#/definitions/jsonpatch" +} diff --git a/src/pyhf/schemas/1.1.0/measurement.json b/src/pyhf/schemas/1.1.0/measurement.json new file mode 100644 index 0000000000..09db479667 --- /dev/null +++ b/src/pyhf/schemas/1.1.0/measurement.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft/2020-12/schema#", + "$id": "https://scikit-hep.org/pyhf/schemas/1.1.0/measurement.json", + "$ref": "defs.json#/definitions/measurement" +} diff --git a/src/pyhf/schemas/1.1.0/model.json b/src/pyhf/schemas/1.1.0/model.json new file mode 100644 index 0000000000..a3d6e6ae4a --- /dev/null +++ b/src/pyhf/schemas/1.1.0/model.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft/2020-12/schema#", + "$id": "https://scikit-hep.org/pyhf/schemas/1.1.0/model.json", + "$ref": "defs.json#/definitions/model" +} diff --git a/src/pyhf/schemas/1.1.0/patchset.json b/src/pyhf/schemas/1.1.0/patchset.json new file mode 100644 index 0000000000..f453981dad --- /dev/null +++ b/src/pyhf/schemas/1.1.0/patchset.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft/2020-12/schema#", + "$id": "https://scikit-hep.org/pyhf/schemas/1.1.0/patchset.json", + "$ref": "defs.json#/definitions/patchset" +} diff --git a/src/pyhf/schemas/1.1.0/workspace.json b/src/pyhf/schemas/1.1.0/workspace.json new file mode 100644 index 0000000000..22ee3e3736 --- /dev/null +++ b/src/pyhf/schemas/1.1.0/workspace.json @@ -0,0 +1,5 @@ +{ + "$schema": "http://json-schema.org/draft/2020-12/schema#", + "$id": "https://scikit-hep.org/pyhf/schemas/1.1.0/workspace.json", + "$ref": "defs.json#/definitions/workspace" +} From 7e73ce1426edee7fd0a21465ebc06f70afebd9f0 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Fri, 8 Dec 2023 11:10:13 +0100 Subject: [PATCH 2/5] more change --- src/pyhf/schemas/1.1.0/defs.json | 79 +++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/src/pyhf/schemas/1.1.0/defs.json b/src/pyhf/schemas/1.1.0/defs.json index ac06cc0a8f..ef32c366e5 100644 --- a/src/pyhf/schemas/1.1.0/defs.json +++ b/src/pyhf/schemas/1.1.0/defs.json @@ -76,25 +76,46 @@ }, "axis": { "type": "object", - "MAKE THIS ONEOF": "", - "(A)": "", - "properties_oneof": { - "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, - "max": { "type": "number" }, - "min": { "type": "number" }, - "nbins": { "type": "number" } - }, - "(B)": "", - "properties": { - "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, - "edges": { "type": "array", "items": { "type": "number", "minItems": 2 } } - } + "oneOf": [ + { + "required": [ "value" ], + "properties": { + "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, + "max": { "type": "number" }, + "min": { "type": "number" }, + "nbins": { "type": "number" } + } + }, + { + "properties": { + "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, + "edges": { "type": "array", "items": { "type": "number", "minItems": 2 } } + } + } + ] + }, + "histogram": { + "type": "object", + "properties": { + "contents": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + }, + "required": ["contents"], + "additionalProperties": false + }, + "histogramWithErrors": { + "type": "object", + "properties": { + "contents": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, + "errors": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + }, + "required": ["contents"], + "additionalProperties": false }, "sample": { "type": "object", "properties": { "name": { "type": "string" }, - "data": { "type": "object", "properties": { "contents": { "type": "array", "items": {"type": "number"}, "minItems": 1 }} }, + "data": { "type": "object", "$ref": "#/definitions/histogramWithErrors" }, "modifiers": { "type": "array", "items": { @@ -122,12 +143,13 @@ "data": { "type": "object", "properties": { - "lo_data": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, - "hi_data": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + "lo": { "type": "object", "$ref": "#/definitions/histogram" }, + "hi": { "type": "object", "$ref": "#/definitions/histogram" } }, "required": ["lo_data", "hi_data"], "additionalProperties": false - } + }, + "parameter": { "type": "string" } }, "required": ["name", "type", "data"], "additionalProperties": false @@ -137,7 +159,8 @@ "properties": { "name": { "const": "lumi" }, "type": { "const": "lumi" }, - "data": { "type": "null" } + "data": { "type": "null" }, + "parameter": { "type": "string" } }, "required": ["name", "type", "data"], "additionalProperties": false @@ -147,9 +170,10 @@ "properties": { "name": { "type": "string" }, "type": { "const": "normfactor" }, - "data": { "type": "null" } + "data": { "type": "null" }, + "parameter": { "type": "string" } }, - "required": ["name", "type", "data"], + "required": ["name", "type"], "additionalProperties": false }, "normsys": { @@ -165,7 +189,8 @@ }, "required": ["lo", "hi"], "additionalProperties": false - } + }, + "parameter": { "type": "string" } }, "required": ["name", "type", "data"], "additionalProperties": false @@ -175,9 +200,10 @@ "properties": { "name": { "type": "string" }, "type": { "const": "shapefactor" }, - "data": { "type": "null" } + "data": { "type": "null" }, + "parameters": { "type": "array", "items": { "type": "string" }} }, - "required": ["name", "type", "data"], + "required": ["name", "type"], "additionalProperties": false }, "shapesys": { @@ -185,7 +211,8 @@ "properties": { "name": { "type": "string" }, "type": { "const": "shapesys" }, - "data": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + "data": { "type": "object", "$ref": "#/definitions/histogram" }, + "parameters": { "type": "array", "items": { "type": "string" }} }, "required": ["name", "type", "data"], "additionalProperties": false @@ -195,9 +222,9 @@ "properties": { "name": { "type": "string" }, "type": { "const": "staterror" }, - "data": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + "parameters": { "type": "array", "items": { "type": "string" }} }, - "required": ["name", "type", "data"], + "required": ["name", "type"], "additionalProperties": false } }, From f546813e8ab0715f3d13424f7eafb78520a8c7a7 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Fri, 8 Dec 2023 11:29:12 +0100 Subject: [PATCH 3/5] fix --- src/pyhf/schemas/1.1.0/defs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyhf/schemas/1.1.0/defs.json b/src/pyhf/schemas/1.1.0/defs.json index ef32c366e5..17ed0abd1b 100644 --- a/src/pyhf/schemas/1.1.0/defs.json +++ b/src/pyhf/schemas/1.1.0/defs.json @@ -146,7 +146,7 @@ "lo": { "type": "object", "$ref": "#/definitions/histogram" }, "hi": { "type": "object", "$ref": "#/definitions/histogram" } }, - "required": ["lo_data", "hi_data"], + "required": ["lo", "hi"], "additionalProperties": false }, "parameter": { "type": "string" } From b4dcad5ae4377fa611555732cd68bb090bbbd95b Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Fri, 8 Dec 2023 12:21:20 +0100 Subject: [PATCH 4/5] more changes --- src/pyhf/schemas/1.1.0/defs.json | 84 ++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 19 deletions(-) diff --git a/src/pyhf/schemas/1.1.0/defs.json b/src/pyhf/schemas/1.1.0/defs.json index 17ed0abd1b..2c75b02e46 100644 --- a/src/pyhf/schemas/1.1.0/defs.json +++ b/src/pyhf/schemas/1.1.0/defs.json @@ -6,13 +6,16 @@ "type": "object", "properties": { "distributions": { "type": "array", "items": {"$ref": "#/definitions/distribution"}, "minItems": 1 }, + "domains": { "type": "array", "items": {"$ref": "#/definitions/domain"}, "minItems": 1 }, + "inits": { "type": "array", "items": {"$ref": "#/definitions/init"}, "minItems": 1 }, + "likelihoods": { "type": "array", "items": {"$ref": "#/definitions/likelihood"}, "minItems": 1 }, "measurements": { "type": "array", "items": {"$ref": "#/definitions/measurement"}, "minItems": 1 }, - "observations": { "type": "array", "items": {"$ref": "#/definitions/observation" }, "minItems": 1 }, + "datasets": { "type": "array", "items": {"$ref": "#/definitions/dataset" }, "minItems": 1 }, "type": { "const": "histfactory_dist" }, "version": { "const": "1.1.0" } }, "additionalProperties": false, - "required": ["distributions", "measurements", "observations", "version"] + "required": ["distributions", "measurements", "datasets", "version"] }, "model": { "type": "object", @@ -23,43 +26,66 @@ "additionalProperties": false, "required": ["channels"] }, - "observation": { + "domain": { + "type": "object", + "properties": { + "name": { "type" : "string" }, + "type": { "const": "product_domain" }, + "axes": { "type": "array", "items": {"$ref": "#/definitions/unbinnedAxis"}, "minItems": 1} + }, + "additionalProperties": false, + "required": ["name", "type", "axes"] + }, + "init": { + "type": "object", + "properties": { + "name": { "type" : "string" }, + "data": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, + "fixed": { "type": "boolean" } + }, + "additionalProperties": false, + "required": ["name", "type", "axes"] + }, + "dataset": { "type": "object", "properties": { + "axes": { "type": "array", "items": {"$ref": "#/definitions/binnedAxis"}, "minItems": 1, "maxItems": 1}, "name": { "type": "string" }, - "data": { "type": "array", "items": {"type": "number"}, "minItems": 1 } + "type": { "const": "binned" }, + "contents": { "type": "array", "items": {"type": "number"}, "minItems": 1 } }, - "required": ["name", "data"], + "required": ["name", "type", "contents"], "additionalProperties": false }, - "measurement": { + "likelihood": { "type": "object", "properties": { "name": { "type": "string" }, - "config": { "$ref": "#/definitions/config" } + "distributions": { "type": "array", "items": { "type": "string" } }, + "datasets": { "type": "array", "items": { "type": "string" } } }, - "required": ["name", "config"], + "required": ["name", "distributions", "datasets"], "additionalProperties": false }, - "config": { + "measurement": { "type": "object", "properties": { + "name": { "type": "string" }, "poi": { "type" : "string" }, - "parameters": { "type": "array", "items": {"$ref": "#/definitions/parameter"} } + "parameters": { "type": "array", "items": {"$ref": "#/definitions/parameter"} }, + "domains": { "type": "array", "items": {"type": "string"}}, + "likelihood": { "type": "string" } }, - "required": ["poi", "parameters"], + "required": ["name", "poi", "parameters", "likelihood"], "additionalProperties": false }, "parameter": { "type": "object", "properties": { "name": { "type": "string" }, - "inits": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, - "bounds": { "type": "array", "items": {"type": "array", "items": {"type": "number", "minItems": 2, "maxItems": 2}}, "minItems": 1 }, "auxdata": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, "factors": { "type": "array", "items": {"type": "number"}, "minItems": 1 }, - "sigmas": { "type": "array", "items": {"type": "number"}, "minItems": 1}, - "fixed": { "type": "boolean" } + "sigmas": { "type": "array", "items": {"type": "number"}, "minItems": 1} }, "required": ["name"], "additionalProperties": false @@ -69,31 +95,51 @@ "properties": { "name": { "type": "string" }, "samples": { "type": "array", "items": {"$ref": "#/definitions/sample"}, "minItems": 1 }, - "axes": { "type": "array", "items": {"$ref": "#/definitions/axis"}, "minItems": 1, "maxItems": 1} + "axes": { "type": "array", "items": {"$ref": "#/definitions/binnedAxis"}, "minItems": 1, "maxItems": 1} }, "required": ["name", "samples"], "additionalProperties": false }, "axis": { + "type": "object", + "oneOf": [ + { "$ref": "#/definitions/unbinnedAxis" }, + { "$ref": "#/definitions/binnedAxis" } + ] + }, + "binnedAxis": { "type": "object", "oneOf": [ { - "required": [ "value" ], "properties": { "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, "max": { "type": "number" }, "min": { "type": "number" }, "nbins": { "type": "number" } - } + }, + "required": [ "name", "max", "min", "nbins" ], + "additionalProperties": false }, { "properties": { "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, "edges": { "type": "array", "items": { "type": "number", "minItems": 2 } } - } + }, + "required": [ "name", "edges" ], + "additionalProperties": false } ] }, + "unbinnedAxis": { + "type": "object", + "properties": { + "name": { "type": "string", "pattern": "^[a-zA-Z0-9_]+$" }, + "max": { "type": "number" }, + "min": { "type": "number" } + }, + "required": [ "name", "max", "min" ], + "additionalProperties": false + }, "histogram": { "type": "object", "properties": { From 5d3b7433967c86397222621ef4194c5b1f1c8283 Mon Sep 17 00:00:00 2001 From: Giordon Stark Date: Fri, 8 Dec 2023 15:51:46 +0100 Subject: [PATCH 5/5] blah --- src/pyhf/schemas/1.1.0/defs.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pyhf/schemas/1.1.0/defs.json b/src/pyhf/schemas/1.1.0/defs.json index 2c75b02e46..5ba70e014a 100644 --- a/src/pyhf/schemas/1.1.0/defs.json +++ b/src/pyhf/schemas/1.1.0/defs.json @@ -11,11 +11,10 @@ "likelihoods": { "type": "array", "items": {"$ref": "#/definitions/likelihood"}, "minItems": 1 }, "measurements": { "type": "array", "items": {"$ref": "#/definitions/measurement"}, "minItems": 1 }, "datasets": { "type": "array", "items": {"$ref": "#/definitions/dataset" }, "minItems": 1 }, - "type": { "const": "histfactory_dist" }, "version": { "const": "1.1.0" } }, "additionalProperties": false, - "required": ["distributions", "measurements", "datasets", "version"] + "required": ["distributions", "likelihoods", "measurements", "datasets", "version"] }, "model": { "type": "object", @@ -44,7 +43,7 @@ "fixed": { "type": "boolean" } }, "additionalProperties": false, - "required": ["name", "type", "axes"] + "required": ["name", "data"] }, "dataset": { "type": "object", @@ -54,7 +53,7 @@ "type": { "const": "binned" }, "contents": { "type": "array", "items": {"type": "number"}, "minItems": 1 } }, - "required": ["name", "type", "contents"], + "required": ["axes", "name", "type", "contents"], "additionalProperties": false }, "likelihood": { @@ -95,9 +94,10 @@ "properties": { "name": { "type": "string" }, "samples": { "type": "array", "items": {"$ref": "#/definitions/sample"}, "minItems": 1 }, - "axes": { "type": "array", "items": {"$ref": "#/definitions/binnedAxis"}, "minItems": 1, "maxItems": 1} + "axes": { "type": "array", "items": {"$ref": "#/definitions/binnedAxis"}, "minItems": 1, "maxItems": 1}, + "type": { "const": "histfactory_dist" } }, - "required": ["name", "samples"], + "required": ["name", "samples", "axes", "type"], "additionalProperties": false }, "axis": {