Skip to content

Internal: Simplify handling of scalar unnamed datasets and groups #748

@ehennestad

Description

@ehennestad

Currently, if any schema specifies a scalar*, unnamed* and typed* dataset or group, these are mapped to a types.untyped.Anon class. In contrast, non-scalar, unnamed and typed datasets or groups are mapped to a types.untyped.Set class.

*scalar: the quantity key of a specification has a value of 1, ? or zero_or_one
*unnamed: the name key in the specification does not have a value
*typed: the neurodata_type_inc or neurodata_type_def key of a spec has a value

Schema example:

groups:
- neurodata_type_def: AnonGroup
neurodata_type_inc: NWBDataInterface
groups:
- neurodata_type_inc: AnonGroup
quantity: '?'
datasets:
- neurodata_type_def: AnonData
quantity: '?'

It is unclear why these cases are handled by two different classes. Possibly to enforce the quantity specifier, as there is currently no proper validation of quantities in MatNWB (See for example Issue 697 and Issue 679).

Proposal: implement proper quantity validation and then unify types.untyped.Anon and types.untyped.Set.

This was recently brought to light through the work on PR 732 where support for unnamed (scalar & non-scalar) Links is added

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: enhancementimprovements of code or code behaviorpriority: lowalternative solution already working and/or relevant to only specific user(s)status: todosomething needs to be donetopic: matnwb-apirelated to improving the matnwb api

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions