Skip to content

Add reference_double_float and reference_triple_float schemas#103

Open
nkemnitz wants to merge 1 commit into
CAVEconnectome:masterfrom
ZettaAI:feat/reference-float-tuples
Open

Add reference_double_float and reference_triple_float schemas#103
nkemnitz wants to merge 1 commit into
CAVEconnectome:masterfrom
ZettaAI:feat/reference-float-tuples

Conversation

@nkemnitz

@nkemnitz nkemnitz commented Jul 2, 2026

Copy link
Copy Markdown

🧔‍♂️Summary

I have three distinct "scores" for each of my synapses. Right now I use one reference_float table for each of those, but it's causing a lot of bloat. As I see it, I currently have 3 options:

option synapse table score storage total Δ vs no-scores
synapse, no scores 64 0 64 GB
new schema, 3 scores baked in ~67 (64 + ~3) in-row ~67 GB +3 GB
synapse + 1 ref table (3 scores) 64 ~25 ~89 GB +25 GB
synapse + 3 ref tables (current) 64 ~73 ~137 GB +73 GB

Not sure what the best approach is. The scoring system might change in the future (new column names, more or fewer columns), so I don't really want to create a new synapse schema, and a schema with column names specifically for this scored synapse table won't be of any use to anybody else (including future me)...

So I think the best short-term compromise is have a generic reference_triple_float column, which helps a bit with storage size and has some reuseability, I hope?


🤖 Summary

Adds two reference annotation schemas for attaching a pair or triple of float
values to another annotation — e.g. multiple per-synapse scores (detection mean/median +
assignment confidence) — complementing the existing single-value reference_tag_float.

  • ReferenceDoubleFloatreference_double_float (value, value2)
  • ReferenceTripleFloatreference_triple_float (value, value2, value3)

Both subclass ReferenceAnnotation (so they carry target_id + valid, no tag) and are
registered in type_mapping. The value / value2 / value3 naming follows the existing
multi-field convention (e.g. bound_double_tag's tag / tag2).

Motivation

Storing N independent floats per annotation currently needs N separate reference_tag_float
tables — one row plus full annotation overhead per value. A single multi-float reference
collapses that into one row, materially reducing storage and query overhead when every target
annotation carries the same fixed set of scalars.

Changes

  • emannotationschemas/schemas/reference_float.py — the two schema classes
  • emannotationschemas/__init__.py — imports + type_mapping entries
  • tests/test_reference_float_schema.py — load/validation + registry tests

Testing

The 4 new tests pass, and flattening yields the expected columns:

  • reference_double_floattarget_id, valid, value, value2
  • reference_triple_floattarget_id, valid, value, value2, value3

🤖 Generated with Claude Code

Two reference annotation schemas for attaching a pair or triple of float
values to another annotation (e.g. multiple per-synapse scores),
complementing the single-value reference_tag_float. Both subclass
ReferenceAnnotation (target_id + value fields, no tag) and register in
type_mapping as reference_double_float / reference_triple_float.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant