By default, a dataset's shape is null which means the attribute/dataset is a scalar. ref
In object-oriented programming - specifically, the Liskov substitution principle - and our type system, subtypes (subclasses) should not expand the range of allowed options from the supertype (superclass).
The dataset data type Data has no shape defined, so its shape is scalar. Pretty much all subtypes of Data define a non-scalar shape. This breaks the above principle.
This had low impact because almost all subtypes of Data that are used define a shape (except for NWB's ScratchData) but as we are now trying to improve how the API resolves and validates shapes, the base shape matters.
Option 1: Add scalar, 1D, 2D, 3D, 4D, 5D shape options to Data.
- Problem: The schema language does not allow one to specify a dataset is either scalar or 1D.
- Solution 1: We could add an option where shape = 0 means scalar.
- Solution 2: We could add an option where shape = "ANY" means any shape
Option 2: Make Data a special case where the default is any shape. This is kind of hacky.
Option 3: Change the default shape to be any shape for datasets. This could break existing schema that do not specify a shape and assume it is a scalar. I think other options are better.
By default, a dataset's shape is
nullwhich means the attribute/dataset is a scalar. refIn object-oriented programming - specifically, the Liskov substitution principle - and our type system, subtypes (subclasses) should not expand the range of allowed options from the supertype (superclass).
The dataset data type
Datahas no shape defined, so its shape is scalar. Pretty much all subtypes ofDatadefine a non-scalar shape. This breaks the above principle.This had low impact because almost all subtypes of
Datathat are used define a shape (except for NWB'sScratchData) but as we are now trying to improve how the API resolves and validates shapes, the base shape matters.Option 1: Add scalar, 1D, 2D, 3D, 4D, 5D shape options to
Data.Option 2: Make
Dataa special case where the default is any shape. This is kind of hacky.Option 3: Change the default shape to be any shape for datasets. This could break existing schema that do not specify a shape and assume it is a scalar. I think other options are better.