From 84d30654326413cf5184248020474e6f9581daca Mon Sep 17 00:00:00 2001 From: "bethanny.danskin" Date: Thu, 23 May 2024 16:08:04 -0700 Subject: [PATCH] added reference tag type adding a reference tag with a float field, for a reference with both text and value. --- emannotationschemas/__init__.py | 4 ++++ emannotationschemas/schemas/reference_text_float.py | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 emannotationschemas/schemas/reference_text_float.py diff --git a/emannotationschemas/__init__.py b/emannotationschemas/__init__.py index fc5c77a..7ed6acb 100644 --- a/emannotationschemas/__init__.py +++ b/emannotationschemas/__init__.py @@ -59,6 +59,9 @@ BoundBoolWithValid, BoundTagWithValid, ) +from emannotationschemas.schemas.reference_text_float import ( + ReferenceTagFloat, +) from emannotationschemas.errors import UnknownAnnotationTypeException from emannotationschemas.flatten import create_flattened_schema @@ -111,6 +114,7 @@ "bound_tag_bool_valid": BoundBoolWithValid, "bound_tag_valid": BoundTagWithValid, "reference_integer": ReferenceInteger, + "reference_tag_float": ReferenceTagFloat, } diff --git a/emannotationschemas/schemas/reference_text_float.py b/emannotationschemas/schemas/reference_text_float.py new file mode 100644 index 0000000..fb38c81 --- /dev/null +++ b/emannotationschemas/schemas/reference_text_float.py @@ -0,0 +1,10 @@ +import marshmallow as mm +from emannotationschemas.schemas.base import ( + ReferenceTagAnnotation, +) + +class ReferenceTagFloat(ReferenceTagAnnotation): + value = mm.fields.Float( + required=True, desription="Float value to be attached to the annotation" + ) + \ No newline at end of file