Skip to content

[Bug]: Scalar/singleton dataset not exported as such for inherited datasets #764

@ehennestad

Description

@ehennestad

Branch

764-inherited-scalar-shape-export

What happened?

Given the following type definitions:

groups:
- neurodata_type_def: NonScalarData
  neurodata_type_inc: NWBContainer
  datasets:
  - name: data
    dtype: float64
    shape:
    - null

- neurodata_type_def: ScalarDataInherited
  neurodata_type_inc: NonScalarData
  datasets:
  - name: data
    shape: 
    - 1

- neurodata_type_def: ScalarData
  neurodata_type_inc: NWBContainer
  datasets:
  - name: data
    dtype: float64
    shape:
    - 1

ScalarDataInherited and ScalarData are functionally identical, but when exported from MatNWB, ScalarDataInherited is exported as a simple (H5S_SIMPLE) dataset, and ScalarData is exported as a scalar dataset (H5S_SCALAR).

This is because a subclass export method will delegate export of all datasets defined in superclasses to the superclass export method, and the export method implementation in turn will decide whether a dataset should be exported with scalar or simple dataspace type.

Steps to Reproduce

N/A

Error Message

N/A

Operating System

macOS

Matlab Version

R2023b

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions