Dynamic Annotation DB package

dynamicannotationdb.errors module

exception dynamicannotationdb.errors.AnnotationInsertLimitExceeded(limit: int, length: int, message: str = 'Annotation limit exceeded')[source]

Bases: ValueError

Exception raised when amount of annotations exceeds defined limit.

exception dynamicannotationdb.errors.BadRequest[source]

Bases: Exception

exception dynamicannotationdb.errors.IdsAlreadyExists[source]

Bases: KeyError

Annotation IDs already exists in the segmentation table

exception dynamicannotationdb.errors.NoAnnotationsFoundWithID(anno_id: int)[source]

Bases: Exception

No annotation found with specified ID

exception dynamicannotationdb.errors.TableAlreadyExists[source]

Bases: KeyError

Table name already exists in the Metadata table

exception dynamicannotationdb.errors.TableNameNotFound[source]

Bases: KeyError

Table name is not found in the Metadata table

exception dynamicannotationdb.errors.UpdateAnnotationError(target_id: int, superceded_id: int, message: str = 'Annotation limit exceeded')[source]

Bases: ValueError

dynamicannotationdb.key_utils module

dynamicannotationdb.key_utils.build_segmentation_table_name(annotation_table_name: str, segmentation_source: str)str[source]

Creates a table name that combines annotation table and appends segmentation table name

Parameters
  • annotation_table_name (str) – exiting annotation table name

  • pcg_table_name (str) – name of chunkedgraph table

Returns

formatted name of table combining the annotation table id with chunkedgraph segmentation source name

Return type

str

dynamicannotationdb.key_utils.build_table_id(aligned_volume: str, table_name: str)str[source]

Combines aligned_volume name and specified table name to create specific table id

Parameters
  • aligned_volume (str) – name of aligned volume

  • table_name (str) – name of table assigned to an aligned volume

Returns

formatted table_id

Return type

str

dynamicannotationdb.key_utils.get_dataset_name_from_table_id(table_id: str)str[source]

Extracts the aligned volume name from table id string

Parameters

table_id (str) –

Returns

name of aligned volume in table id

Return type

str

dynamicannotationdb.key_utils.get_table_name_from_table_id(table_id: str)str[source]

Extracts table name from table_id string :param table_id: :type table_id: str

Returns

table name in table id

Return type

str

dynamicannotationdb.models module

class dynamicannotationdb.models.AnnoMetadata(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

created
deleted
description
flat_segmentation_source
id
reference_table
schema_type
table_name
user_id
valid
class dynamicannotationdb.models.SegmentationMetadata(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base

annotation_table
created
deleted
id
last_updated
pcg_table_name
schema_type
segmentation_source
table_name
valid