From 90482cda69b8044a2635abf375d8d8b12b3893d0 Mon Sep 17 00:00:00 2001 From: Ben Pedigo Date: Mon, 23 Feb 2026 11:00:11 -0800 Subject: [PATCH 1/4] Add SimpleGroupIndexed class with indexed group_id --- emannotationschemas/schemas/groups.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emannotationschemas/schemas/groups.py b/emannotationschemas/schemas/groups.py index 442a4ab..b7bdf11 100644 --- a/emannotationschemas/schemas/groups.py +++ b/emannotationschemas/schemas/groups.py @@ -7,3 +7,10 @@ class SimpleGroup(ReferenceAnnotation): required=True, description="group id", ) + +class SimpleGroupIndexed(ReferenceAnnotation): + group_id = mm.fields.Int( + required=True, + description="group id", + index=True, + ) From 39ec2ec55287290c4c28dc0b85dc379a9ab71d2e Mon Sep 17 00:00:00 2001 From: Ben Pedigo Date: Mon, 23 Feb 2026 12:17:05 -0800 Subject: [PATCH 2/4] add to imports --- emannotationschemas/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emannotationschemas/__init__.py b/emannotationschemas/__init__.py index 56c8343..de8e3be 100644 --- a/emannotationschemas/__init__.py +++ b/emannotationschemas/__init__.py @@ -52,7 +52,7 @@ DigitalTwinPropertiesBCM, ) from emannotationschemas.schemas.glia_contact import GliaContact -from emannotationschemas.schemas.groups import SimpleGroup +from emannotationschemas.schemas.groups import SimpleGroup, SimpleGroupIndexed from emannotationschemas.schemas.neuropil import FlyNeuropil from emannotationschemas.schemas.nucleus_detection import NucleusDetection from emannotationschemas.schemas.postsynaptic_compartment import PostsynapticCompartment @@ -124,6 +124,7 @@ "representative_point": RepresentativePoint, "reference_synapse_valid": ValidSynapse, "reference_simple_group": SimpleGroup, + "reference_simple_group_indexed": SimpleGroupIndexed, "fly_cell_type": FlyCellType, "fly_cell_type_ext": FlyCellTypeExt, "braincircuits_annotation_user": BrainCircuitsBoundTagAnnotationUser, From fa344514df05536954e6275befb4cb5c377ff880 Mon Sep 17 00:00:00 2001 From: Ben Pedigo Date: Mon, 23 Feb 2026 12:32:59 -0800 Subject: [PATCH 3/4] add test --- tests/test_simple_group.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/test_simple_group.py diff --git a/tests/test_simple_group.py b/tests/test_simple_group.py new file mode 100644 index 0000000..4690828 --- /dev/null +++ b/tests/test_simple_group.py @@ -0,0 +1,25 @@ +from emannotationschemas.schemas.groups import SimpleGroup, SimpleGroupIndexed + +good_simple_group = { + "pt": {"position": [31, 32, 33]}, + "group_id": 42, +} + +good_simple_group_indexed = { + "pt": {"position": [10, 20, 30]}, + "group_id": 123, +} + + +def test_simple_group_schema(): + schema = SimpleGroup() + result = schema.load(good_simple_group) + assert result["group_id"] == 42 + assert result["pt"]["position"] == [31, 32, 33] + + +def test_simple_group_indexed_schema(): + schema = SimpleGroupIndexed() + result = schema.load(good_simple_group_indexed) + assert result["group_id"] == 123 + assert result["pt"]["position"] == [10, 20, 30] From 08dcbd7b7d8c1fe93830a723a7f4162c5ff9b8fe Mon Sep 17 00:00:00 2001 From: Ben Pedigo Date: Mon, 23 Feb 2026 12:37:35 -0800 Subject: [PATCH 4/4] fix tests --- tests/test_simple_group.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_simple_group.py b/tests/test_simple_group.py index 4690828..51240ab 100644 --- a/tests/test_simple_group.py +++ b/tests/test_simple_group.py @@ -3,11 +3,13 @@ good_simple_group = { "pt": {"position": [31, 32, 33]}, "group_id": 42, + "target_id": 456, } good_simple_group_indexed = { "pt": {"position": [10, 20, 30]}, "group_id": 123, + "target_id": 456, }