Skip to content

Commit

Permalink
Merge pull request #253 from NeurodataWithoutBorders/debug-pipeline
Browse files Browse the repository at this point in the history
Fix Pipeline nwbtest errors
  • Loading branch information
lawrence-mbf authored Dec 31, 2020
2 parents 7279c93 + 044979f commit a486cf7
Show file tree
Hide file tree
Showing 5 changed files with 208 additions and 7 deletions.
14 changes: 8 additions & 6 deletions generateCore.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@ function generateCore(version)
validateattributes(version, {'char'}, {'scalartext'});
end

[nwbLocation, ~, ~] = fileparts(mfilename('fullpath'));
schemaPath = fullfile(nwbLocation, 'nwb-schema', version);
matNwbLocation = misc.getMatnwbDir();
schemaPath = fullfile(matNwbLocation, 'nwb-schema', version);
corePath = fullfile(schemaPath, 'core', 'nwb.namespace.yaml');
commonPath = fullfile(schemaPath,...
'hdmf-common-schema', ...
'common',...
'namespace.yaml');
assert(2 == exist(corePath, 'file'),...
'MATNWB:nwbread:missingSpec',...
'MATNWB:GenerateCore:missingCoreSchema',...
'Cannot find suitable core namespace for schema version `%s`',...
version);
assert(2 == exist(commonPath, 'file'),...
'MatNWB:GenerateCore:MissingCoreSchema',...
'Cannot find suitable hdmf-common namespace for schema version `%s`',...
version);

if 2 == exist(commonPath, 'file')
generateExtension(commonPath);
end
generateExtension(commonPath);
generateExtension(corePath);
end
1 change: 0 additions & 1 deletion nwb-schema/2.2.5/hdmf-common-schema
Submodule hdmf-common-schema deleted from b2e7b4
21 changes: 21 additions & 0 deletions nwb-schema/2.2.5/hdmf-common-schema/common/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespaces:
- name: hdmf-common
doc: Common data structures provided by HDMF
author:
- Andrew Tritt
- Oliver Ruebel
- Ryan Ly
- Ben Dichter
contact:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
full_name: HDMF Common
schema:
- doc: data types for a column-based table
source: table.yaml
title: Table data types
- doc: data types for different types of sparse matrices
source: sparse.yaml
version: 1.1.3
24 changes: 24 additions & 0 deletions nwb-schema/2.2.5/hdmf-common-schema/common/sparse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
groups:
- data_type_def: CSRMatrix
doc: a compressed sparse row matrix
attributes:
- name: shape
dtype: int
shape:
- 2
doc: the shape of this sparse matrix
datasets:
- name: indices
dtype: int
shape:
- null
doc: column indices
- name: indptr
dtype: int
shape:
- null
doc: index pointer
- name: data
shape:
- null
doc: values in the matrix
155 changes: 155 additions & 0 deletions nwb-schema/2.2.5/hdmf-common-schema/common/table.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
datasets:
- data_type_def: Data
doc: An abstract data type for a dataset.

- data_type_def: Index
data_type_inc: Data
doc: Pointers that index data values.
attributes:
- name: target
dtype:
target_type: Data
reftype: object
doc: Target dataset that this index applies to.

- data_type_def: VectorData
data_type_inc: Data
doc: An n-dimensional dataset representing a column of a DynamicTable.
If used without an accompanying VectorIndex, first dimension is
along the rows of the DynamicTable and each step along the first
dimension is a cell of the larger table. VectorData can also be
used to represent a ragged array if paired with a VectorIndex.
This allows for storing arrays of varying length in a single cell
of the DynamicTable by indexing into this VectorData. The first
vector is at VectorData[0:VectorIndex(0)+1]. The second vector is at
VectorData[VectorIndex(0)+1:VectorIndex(1)+1], and so on.
dims:
- - dim0
- - dim0
- dim1
- - dim0
- dim1
- dim2
- - dim0
- dim1
- dim2
- dim3
shape:
- - null
- - null
- null
- - null
- null
- null
- - null
- null
- null
- null
attributes:
- name: description
dtype: text
doc: Description of what these vectors represent.

- data_type_def: VectorIndex
data_type_inc: Index
doc: Used with VectorData to encode a ragged array. An array of indices
into the first dimension of the target VectorData, and forming a map
between the rows of a DynamicTable and the indices of the VectorData.
dims:
- num_rows
shape:
- null
attributes:
- name: target
dtype:
target_type: VectorData
reftype: object
doc: Reference to the target dataset that this index applies to.

- data_type_def: ElementIdentifiers
data_type_inc: Data
default_name: element_id
dtype: int
dims:
- num_elements
shape:
- null
doc: A list of unique identifiers for values within a dataset, e.g. rows of a DynamicTable.

- data_type_def: DynamicTableRegion
data_type_inc: VectorData
dtype: int
doc: DynamicTableRegion provides a link from one table to an index or region of another. The `table` attribute is a
link to another `DynamicTable`, indicating which table is referenced, and the data is int(s) indicating the row(s)
(0-indexed) of the target array. `DynamicTableRegion`s can be used to associate rows with repeated meta-data without
data duplication. They can also be used to create hierarchical relationships between multiple `DynamicTable`s.
`DynamicTableRegion` objects may be paired with a `VectorIndex` object to create ragged references, so a single cell
of a `DynamicTable` can reference many rows of another `DynamicTable`.
dims:
- num_rows
shape:
- null
attributes:
- name: table
dtype:
target_type: DynamicTable
reftype: object
doc: Reference to the DynamicTable object that this region applies to.
- name: description
dtype: text
doc: Description of what this table region points to.

groups:
- data_type_def: Container
doc: An abstract data type for a generic container storing collections of data and
metadata. Base type for all data and metadata containers.

- data_type_def: DynamicTable
data_type_inc: Container
doc: A group containing multiple datasets that are aligned on the first dimension
(Currently, this requirement if left up to APIs to check and enforce). Apart from
a column that contains unique identifiers for each row there are no other required
datasets. Users are free to add any number of VectorData objects here. Table functionality
is already supported through compound types, which is analogous to storing an
array-of-structs. DynamicTable can be thought of as a struct-of-arrays. This provides
an alternative structure to choose from when optimizing storage for anticipated
access patterns. Additionally, this type provides a way of creating a table without
having to define a compound type up front. Although this convenience may be attractive,
users should think carefully about how data will be accessed. DynamicTable is
more appropriate for column-centric access, whereas a dataset with a compound
type would be more appropriate for row-centric access. Finally, data size should
also be taken into account. For small tables, performance loss may be an acceptable
trade-off for the flexibility of a DynamicTable. For example, DynamicTable was
originally developed for storing trial data and spike unit metadata. Both of these
use cases are expected to produce relatively small tables, so the spatial locality
of multiple datasets present in a DynamicTable is not expected to have a significant
performance impact. Additionally, requirements of trial and unit metadata tables
are sufficiently diverse that performance implications can be overlooked in favor
of usability.
attributes:
- name: colnames
dtype: text
dims:
- num_columns
shape:
- null
doc: The names of the columns in this table. This should be used to specify
an order to the columns.
- name: description
dtype: text
doc: Description of what is in this dynamic table.
datasets:
- name: id
data_type_inc: ElementIdentifiers
dtype: int
dims:
- num_rows
shape:
- null
doc: Array of unique identifiers for the rows of this dynamic table.
- data_type_inc: VectorData
doc: Vector columns of this dynamic table.
quantity: '*'
- data_type_inc: VectorIndex
doc: Indices for the vector columns of this dynamic table.
quantity: '*'

0 comments on commit a486cf7

Please sign in to comment.