From dfed3e6f092f5b681ae964989aa2d906cc8cd64d Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Mon, 19 Jan 2026 15:25:31 +0000 Subject: [PATCH 1/3] wip - add run start metadata --- run_start_metadata_schema.json | 62 ++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 run_start_metadata_schema.json diff --git a/run_start_metadata_schema.json b/run_start_metadata_schema.json new file mode 100644 index 0000000..44e6562 --- /dev/null +++ b/run_start_metadata_schema.json @@ -0,0 +1,62 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/ISISComputingGroup/DataStreaming/blob/main/run_start_metadata_schema.json", + "title": "run_start_metadata_schema", + "description": "Schema for run start metadata used at ISIS for kafka_dae_diagnostics", + "type": "object", + "properties": { + "num_periods": { + "description": "The maximum number of periods for this run", + "type": "integer" + }, + "num_time_channels": { + "description": "The maximum number of time channels for this run", + "type":"integer" + }, + "time_regimes": { + "description": "The time regimes for this run", + "type": "array", + "minItems": 1, + "items": { + "type": "array", + "description": "time regime rows", + "items": { + "type":"object", + "description": "time regime row", + "properties": { + "from": { + "type": "number" + }, + "to": { + "type": "number" + }, + "steps": { + "type": "number" + }, + "mode": { + "enum": ["dT = C", "dT/T = C", "dT/T**2 = C", "Shifted"] + } + } + } + } + }, + "vetos": { + "description": "The vetos for this run", + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "enabled": { + "type": "boolean" + } + } + } + } + }, + "required": ["num_periods", "num_time_channels", "time_regimes", "vetos"] +} + From 1fc9b9ad68220e6c6e04026f708b6a191faac738 Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Mon, 19 Jan 2026 15:27:44 +0000 Subject: [PATCH 2/3] maximum -> total --- run_start_metadata_schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/run_start_metadata_schema.json b/run_start_metadata_schema.json index 44e6562..ef45c5a 100644 --- a/run_start_metadata_schema.json +++ b/run_start_metadata_schema.json @@ -6,11 +6,11 @@ "type": "object", "properties": { "num_periods": { - "description": "The maximum number of periods for this run", + "description": "The total number of periods for this run", "type": "integer" }, "num_time_channels": { - "description": "The maximum number of time channels for this run", + "description": "The total number of time channels for this run", "type":"integer" }, "time_regimes": { From f3c908601b80963289578654a583e6bfea8dff7e Mon Sep 17 00:00:00 2001 From: Jack Harper Date: Tue, 20 Jan 2026 11:34:18 +0000 Subject: [PATCH 3/3] allow arbitrary time regimes, rename num_time_channels to max_time_channels --- run_start_metadata_schema.json | 61 ++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/run_start_metadata_schema.json b/run_start_metadata_schema.json index ef45c5a..41cc027 100644 --- a/run_start_metadata_schema.json +++ b/run_start_metadata_schema.json @@ -6,37 +6,50 @@ "type": "object", "properties": { "num_periods": { - "description": "The total number of periods for this run", + "description": "The total number of periods for this run, 1 indexed.", "type": "integer" }, - "num_time_channels": { - "description": "The total number of time channels for this run", - "type":"integer" + "max_time_channels": { + "description": "The maximum number of time channels for this run.", + "type": "integer" }, "time_regimes": { - "description": "The time regimes for this run", + "description": "The time regimes for this run.", "type": "array", "minItems": 1, "items": { "type": "array", "description": "time regime rows", "items": { - "type":"object", - "description": "time regime row", - "properties": { - "from": { - "type": "number" - }, - "to": { - "type": "number" + "$comment": "Either linear time regime rows, or an arbitrary list of bin-edges.", + "oneOf": [ + { + "type": "object", + "description": "time regime row", + "properties": { + "from": { + "type": "number" + }, + "to": { + "type": "number" + }, + "steps": { + "type": "number" + }, + "mode": { + "enum": [ + "dT = C", + "dT/T = C", + "dT/T**2 = C", + "Shifted" + ] + } + } }, - "steps": { - "type": "number" - }, - "mode": { - "enum": ["dT = C", "dT/T = C", "dT/T**2 = C", "Shifted"] + { + "type": "integer" } - } + ] } } }, @@ -57,6 +70,10 @@ } } }, - "required": ["num_periods", "num_time_channels", "time_regimes", "vetos"] -} - + "required": [ + "num_periods", + "num_time_channels", + "time_regimes", + "vetos" + ] +} \ No newline at end of file