Skip to content

Commit e40f5f4

Browse files
authored
Merge pull request #252 from NeurodataWithoutBorders/remove-submodules
Remove submodules
2 parents e283f26 + 035469f commit e40f5f4

File tree

106 files changed

+15775
-87
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+15775
-87
lines changed

+misc/getNamespaceDir.m

Lines changed: 12 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function [namespaceDir] = getNamespaceDir(varargin)
1+
function namespaceDir = getNamespaceDir(varargin)
22
% Get the location of the namespaces directory regardless of current MATLAB working directory.
33
% started: 2020.07.02 [11:20:30]
44
% inputs
@@ -8,51 +8,18 @@
88

99
% changelog
1010
% 2020.07.02 [11:24:10] - Function created and added warning if namespaces directory could not be found. - Biafra Ahanonu.
11+
% 2020.12.29 [13:40:00] - Function simplified to use local namespace directory first.
1112
% TODO
1213
%
13-
14-
try
15-
% Get the actual location of the matnwb directory.
16-
fnDir = misc.getMatnwbDir();
17-
18-
% Get full path name to namespaces directory and list of files
19-
namespaceDir = fullfile(fnDir, 'namespaces');
20-
21-
% Check directory exists else throw a warning letting the user know.
22-
dirExists = subfxnDirCheck(namespaceDir,1);
23-
if dirExists==0
24-
namespaceDir = subfxnDefaultNamespaces();
25-
elseif dirExists==1
26-
% Do nothing.
27-
end
28-
catch err
29-
% Attempt to load namespaces directory using prior methods.
30-
namespaceDir = subfxnDefaultNamespaces();
31-
disp(repmat('@',1,7))
32-
disp(getReport(err,'extended','hyperlinks','on'));
33-
disp(repmat('@',1,7))
34-
end
35-
end
36-
function dirExists = subfxnDirCheck(namespaceDir,dispWarning)
37-
if exist(namespaceDir,'dir')==7
38-
dirExists = 1;
39-
else
40-
dirExists = 0;
41-
if dispWarning==1
42-
warning('Directory "namespaces" not found at %s. Using defaults.',namespaceDir)
43-
end
44-
end
45-
end
46-
function namespaceDir = subfxnDefaultNamespaces()
47-
try
48-
namespaceDir = fullfile(misc.getWorkspace(), 'namespaces');
49-
dirExists = subfxnDirCheck(namespaceDir,0);
50-
if dirExists==0
51-
namespaceDir = 'namespaces';
52-
subfxnDirCheck(namespaceDir,0);
53-
end
54-
catch
55-
namespaceDir = 'namespaces';
56-
subfxnDirCheck(namespaceDir,0);
14+
15+
localNamespace = fullfile(misc.getWorkspace(), 'namespaces');
16+
rootNamespace = fullfile(misc.getMatnwbDir(), 'namespaces');
17+
if 7 == exist(localNamespace, 'dir')
18+
namespaceDir = localNamespace;
19+
elseif 7 == exist(rootNamespace, 'dir')
20+
namespaceDir = rootNamespace;
21+
else
22+
warning('Directory "namespaces" not found.');
23+
namespaceDir = '';
5724
end
5825
end

+tests/+system/smokeTest.m

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@
55
function setupOnce(testCase)
66
rootPath = fullfile(fileparts(mfilename('fullpath')), '..', '..');
77
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(rootPath));
8-
% corePath = fullfile(rootPath, 'schema', 'core', 'nwb.namespace.yaml');
9-
% testCase.TestData.registry = generateCore(corePath);
8+
generateCore();
109
end
1110

1211
function teardownOnce(testCase)
13-
% classes = fieldnames(testCase.TestData.registry);
14-
% files = strcat(fullfile('+types', classes), '.m');
15-
% delete(files{:});
1612
end
1713

1814
function setup(testCase)

+tests/+unit/multipleShapesTest.m

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
end
44

55
function setupOnce(testCase)
6-
fileLoc = fileparts(mfilename('fullpath'));
7-
rootPath = fullfile(fileLoc, '..', '..');
8-
schemaPath = fullfile(fileLoc, 'multipleShapesSchema', 'mss.namespace.yaml');
6+
schemaPath = fullfile(misc.getMatnwbDir(),...
7+
'+tests', '+unit', 'multipleShapesSchema', 'mss.namespace.yaml');
98
generateExtension(schemaPath);
10-
testCase.applyFixture(matlab.unittest.fixtures.PathFixture(rootPath));
119
end
1210

1311
function setup(testCase)
1412
testCase.applyFixture(matlab.unittest.fixtures.WorkingFolderFixture);
1513
end
1614

1715
function teardownOnce(~)
18-
rmdir(fullfile('+types', '+mss'), 's');
16+
% rmdir(fullfile('+types', '+mss'), 's');
1917
end
2018

2119
function testMultipleShapesDataset(testCase)

.gitmodules

Lines changed: 0 additions & 18 deletions
This file was deleted.

NwbFile.m

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,13 @@ function export(obj, filename)
4242
try
4343
output_file_id = H5F.create(filename);
4444
catch ME % if file exists, open and edit
45-
isLibraryError = strcmp(ME.identifier,...
46-
'MATLAB:imagesci:hdf5lib:libraryError');
47-
isFileExistsError = isLibraryError &&...
48-
contains(ME.message, '''File exists''');
45+
if verLessThan('matlab', '9.9') % < 2020b
46+
isFileExistsError = strcmp(ME.identifier, 'MATLAB:imagesci:hdf5lib:libraryError')...
47+
&& contains(ME.message, '''File exists''');
48+
else
49+
isFileExistsError = strcmp(ME.identifier, 'MATLAB:imagesci:hdf5io:resourceAlreadyExists');
50+
end
51+
4952
if isFileExistsError
5053
output_file_id = H5F.open(filename, 'H5F_ACC_RDWR', 'H5P_DEFAULT');
5154
else

azure-pipelines.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ pool:
55
vmImage: 'ubuntu-latest'
66

77
steps:
8-
- checkout: self
9-
submodules: recursive
10-
118
- task: InstallMATLAB@0
129
# default to latest version of Matlab installed
1310
#inputs:
1411
# release: R2020a
12+
- checkout: self
1513

1614
- task: UsePythonVersion@0
1715
inputs:
@@ -25,5 +23,5 @@ steps:
2523
2624
- task: RunMATLABCommand@0
2725
inputs:
28-
command: "try, addpath(genpath(pwd)); generateCore(); results = nwbtest; if isempty(results), exit(1); end; catch err, disp(err.message); exit(1); end"
26+
command: "try, addpath(genpath(pwd)); results = nwbtest; if isempty(results), exit(1); end; catch err, disp(err.message); exit(1); end"
2927

nwb-schema/2.2.0

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
datasets:
2+
- neurodata_type_def: NWBData
3+
neurodata_type_inc: Data
4+
doc: An abstract data type for a dataset.
5+
6+
- neurodata_type_def: Image
7+
neurodata_type_inc: NWBData
8+
dtype: numeric
9+
dims:
10+
- - x
11+
- y
12+
- - x
13+
- y
14+
- r, g, b
15+
- - x
16+
- y
17+
- r, g, b, a
18+
shape:
19+
- - null
20+
- null
21+
- - null
22+
- null
23+
- 3
24+
- - null
25+
- null
26+
- 4
27+
doc: An abstract data type for an image. Shape can be 2-D (x, y), or 3-D where the
28+
third dimension can have three or four elements, e.g. (x, y, (r, g, b)) or
29+
(x, y, (r, g, b, a)).
30+
attributes:
31+
- name: resolution
32+
dtype: float32
33+
doc: Pixel resolution of the image, in pixels per centimeter.
34+
required: false
35+
- name: description
36+
dtype: text
37+
doc: Description of the image.
38+
required: false
39+
40+
groups:
41+
- neurodata_type_def: NWBContainer
42+
neurodata_type_inc: Container
43+
doc: An abstract data type for a generic container storing collections of data and
44+
metadata. Base type for all data and metadata containers.
45+
46+
- neurodata_type_def: NWBDataInterface
47+
neurodata_type_inc: NWBContainer
48+
doc: An abstract data type for a generic container storing collections of data,
49+
as opposed to metadata.
50+
51+
- neurodata_type_def: TimeSeries
52+
neurodata_type_inc: NWBDataInterface
53+
doc: General purpose time series.
54+
attributes:
55+
- name: description
56+
dtype: text
57+
default_value: no description
58+
doc: Description of the time series.
59+
required: false
60+
- name: comments
61+
dtype: text
62+
default_value: no comments
63+
doc: Human-readable comments about the TimeSeries. This second descriptive field
64+
can be used to store additional information, or descriptive information if the
65+
primary description field is populated with a computer-readable string.
66+
required: false
67+
datasets:
68+
- name: data
69+
dims:
70+
- - num_times
71+
- - num_times
72+
- num_DIM2
73+
- - num_times
74+
- num_DIM2
75+
- num_DIM3
76+
- - num_times
77+
- num_DIM2
78+
- num_DIM3
79+
- num_DIM4
80+
shape:
81+
- - null
82+
- - null
83+
- null
84+
- - null
85+
- null
86+
- null
87+
- - null
88+
- null
89+
- null
90+
- null
91+
doc: Data values. Data can be in 1-D, 2-D, 3-D, or 4-D. The first dimension
92+
should always represent time. This can also be used to store binary data
93+
(e.g., image frames). This can also be a link to data stored in an external file.
94+
attributes:
95+
- name: conversion
96+
dtype: float32
97+
default_value: 1.0
98+
doc: Scalar to multiply each element in data to convert it to the specified 'unit'.
99+
If the data are stored in acquisition system units or other units
100+
that require a conversion to be interpretable, multiply the data by 'conversion'
101+
to convert the data to the specified 'unit'. e.g. if the data acquisition system
102+
stores values in this object as signed 16-bit integers (int16 range
103+
-32,768 to 32,767) that correspond to a 5V range (-2.5V to 2.5V), and the data
104+
acquisition system gain is 8000X, then the 'conversion' multiplier to get from
105+
raw data acquisition values to recorded volts is 2.5/32768/8000 = 9.5367e-9.
106+
required: false
107+
- name: resolution
108+
dtype: float32
109+
default_value: -1.0
110+
doc: Smallest meaningful difference between values in data, stored in the specified
111+
by unit, e.g., the change in value of the least significant bit, or a larger
112+
number if signal noise is known to be present. If unknown, use -1.0.
113+
required: false
114+
- name: unit
115+
dtype: text
116+
doc: Base unit of measurement for working with the data. Actual stored values are
117+
not necessarily stored in these units. To access the data in these units,
118+
multiply 'data' by 'conversion'.
119+
- name: starting_time
120+
dtype: float64
121+
doc: Timestamp of the first sample in seconds. When timestamps are uniformly
122+
spaced, the timestamp of the first sample can be specified and all subsequent
123+
ones calculated from the sampling rate attribute.
124+
quantity: '?'
125+
attributes:
126+
- name: rate
127+
dtype: float32
128+
doc: Sampling rate, in Hz.
129+
- name: unit
130+
dtype: text
131+
value: seconds
132+
doc: Unit of measurement for time, which is fixed to 'seconds'.
133+
- name: timestamps
134+
dtype: float64
135+
dims:
136+
- num_times
137+
shape:
138+
- null
139+
doc: Timestamps for samples stored in data, in seconds, relative to the
140+
common experiment master-clock stored in NWBFile.timestamps_reference_time.
141+
quantity: '?'
142+
attributes:
143+
- name: interval
144+
dtype: int32
145+
value: 1
146+
doc: Value is '1'
147+
- name: unit
148+
dtype: text
149+
value: seconds
150+
doc: Unit of measurement for timestamps, which is fixed to 'seconds'.
151+
- name: control
152+
dtype: uint8
153+
dims:
154+
- num_times
155+
shape:
156+
- null
157+
doc: Numerical labels that apply to each time point in data for the purpose of
158+
querying and slicing data by these values. If present, the length of this
159+
array should be the same size as the first dimension of data.
160+
quantity: '?'
161+
- name: control_description
162+
dtype: text
163+
dims:
164+
- num_control_values
165+
shape:
166+
- null
167+
doc: Description of each control value. Must be present if control is present.
168+
If present, control_description[0] should describe time points where control == 0.
169+
quantity: '?'
170+
groups:
171+
- name: sync
172+
doc: Lab-specific time and sync information as provided directly from hardware
173+
devices and that is necessary for aligning all acquired time information to
174+
a common timebase. The timestamp array stores time in the common timebase.
175+
This group will usually only be populated in TimeSeries that are
176+
stored external to the NWB file, in files storing raw data. Once timestamp
177+
data is calculated, the contents of 'sync' are mostly for archival purposes.
178+
quantity: '?'
179+
180+
- neurodata_type_def: ProcessingModule
181+
neurodata_type_inc: NWBContainer
182+
doc: A collection of processed data.
183+
attributes:
184+
- name: description
185+
dtype: text
186+
doc: Description of this collection of processed data.
187+
groups:
188+
- neurodata_type_inc: NWBDataInterface
189+
doc: Data objects stored in this collection.
190+
quantity: '*'
191+
- neurodata_type_inc: DynamicTable
192+
doc: Tables stored in this collection.
193+
quantity: '*'
194+
195+
- neurodata_type_def: Images
196+
neurodata_type_inc: NWBDataInterface
197+
default_name: Images
198+
doc: A collection of images.
199+
attributes:
200+
- name: description
201+
dtype: text
202+
doc: Description of this collection of images.
203+
datasets:
204+
- neurodata_type_inc: Image
205+
doc: Images stored in this collection.
206+
quantity: '+'

0 commit comments

Comments
 (0)