hdmf.common.io.table module

class hdmf.common.io.table.DynamicTableMap(spec)

Bases: ObjectMapper

Create a map from AbstractContainer attributes to specifications

Parameters:

spec (DatasetSpec or GroupSpec) – The specification for mapping objects to builders

attr_columns(container, manager)
get_attr_value(spec, container, manager)

Get the value of the attribute corresponding to this spec from the given container

Parameters:
  • spec (Spec) – the spec to get the attribute value for

  • container (DynamicTable) – the container to get the attribute value from

  • manager (BuildManager) – the BuildManager used for managing this build

constructor_args = {'name': <function ObjectMapper.get_container_name>}
obj_attrs = {'colnames': <function DynamicTableMap.attr_columns>}
class hdmf.common.io.table.DynamicTableGenerator(*args, **kwargs)

Bases: CustomClassGenerator

classmethod apply_generator_to_field(field_spec, bases, type_map)

Return True if this is a DynamicTable and the field spec is a column.

classmethod process_field_spec(classdict, docval_args, parent_cls, attr_name, not_inherited_fields, type_map, spec)

Add __columns__ to the classdict and update the docval args for the field spec with the given attribute name. :param classdict: The dict to update with __columns__. :param docval_args: The list of docval arguments. :param parent_cls: The parent class. :param attr_name: The attribute name of the field spec for the container class to generate. :param not_inherited_fields: Dictionary of fields not inherited from the parent class. :param type_map: The type map to use. :param spec: The spec for the container class to generate.

classmethod post_process(classdict, bases, docval_args, spec)

Convert classdict[‘__columns__’] to tuple. :param classdict: The class dictionary. :param bases: The list of base classes. :param docval_args: The dict of docval arguments. :param spec: The spec for the container class to generate.

class hdmf.common.io.table.MeaningsTableMap(spec)

Bases: DynamicTableMap

Object mapper for MeaningsTable.

In HDMF Common Schema 1.10.0+, MeaningsTable.target is stored as an object-reference attribute named “target”. hdmf-common 1.9.0 stored it as a link named “target”. On read, a legacy “target” link is removed from the builder so it is not matched as a VectorData column of the table, and the VectorData it points to is supplied to the target constructor argument. Files that store “target” as the object-reference attribute are handled by the default mapping.

Create a map from AbstractContainer attributes to specifications

Parameters:

spec (DatasetSpec or GroupSpec) – The specification for mapping objects to builders

construct(builder, manager, parent=None)

Construct an AbstractContainer from the given Builder

Parameters:
target_carg(builder, manager)

Supply target from a legacy hdmf-common 1.9.0 “target” link.

Returns the VectorData resolved from a removed “target” link. For files that store “target” as an attribute there is no legacy link, so this returns the NO_OVERRIDE sentinel and the default object-reference resolution supplies the value.

constructor_args = {'name': <function ObjectMapper.get_container_name>, 'target': <function MeaningsTableMap.target_carg>}
obj_attrs = {'colnames': <function DynamicTableMap.attr_columns>}