From 038e935545cfc96e391e8e40847ea7a2b96f69e0 Mon Sep 17 00:00:00 2001 From: Eva Lott Date: Fri, 25 Oct 2024 14:19:07 +0100 Subject: [PATCH] made precision optional --- src/event_model/documents/event_descriptor.py | 2 +- src/event_model/schemas/event_descriptor.json | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/event_model/documents/event_descriptor.py b/src/event_model/documents/event_descriptor.py index 020f9169c..d9cb89084 100644 --- a/src/event_model/documents/event_descriptor.py +++ b/src/event_model/documents/event_descriptor.py @@ -89,7 +89,7 @@ class DataKey(TypedDict): ] precision: NotRequired[ Annotated[ - int, + Optional[int], Field( description="Number of digits after decimal place if " "a floating point number" diff --git a/src/event_model/schemas/event_descriptor.json b/src/event_model/schemas/event_descriptor.json index 7ca69b83f..ea7ef71ed 100644 --- a/src/event_model/schemas/event_descriptor.json +++ b/src/event_model/schemas/event_descriptor.json @@ -107,7 +107,14 @@ "precision": { "title": "Precision", "description": "Number of digits after decimal place if a floating point number", - "type": "integer" + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] }, "shape": { "title": "Shape",