Skip to content

Commit

Permalink
Merge pull request #114 from VH-Lab/id_changes
Browse files Browse the repository at this point in the history
change "reference"/"identifier" to "id"; add "depends_on"
  • Loading branch information
stevevanhooser authored Dec 11, 2019
2 parents ecd318f + 288995e commit ccbf6e8
Show file tree
Hide file tree
Showing 19 changed files with 155 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
{ "definition": "$NDIDOCUMENTPATH\/ndi_document_app.json" }
]
},
"depends_on": [
{ "name": "extraction_parameters_id",
"value": ""
}
],
"spiketimes": {
"extraction_name": "",
"extraction_parameters_file_id": ""
"extraction_name": ""
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
{ "definition": "$NDIDOCUMENTPATH\/ndi_document_app.json" }
]
},
"depends_on": [
{ "name": "extraction_parameters_id",
"value": ""
}
],
"spikewaves": {
"extraction_name": "",
"extraction_parameters_file_id": ""
"extraction_name": ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
{ "definition": "$NDIDOCUMENTPATH\/ndi_document_app.json" }
]
},
"depends_on":[
{ "name": "sorting_parameters_id",
"value": ""
}
],
"spike_clusters": {
"sort_name": "",
"sorting_parameters_file_id": ""
"sort_name": ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
{ "definition": "$NDIDOCUMENTPATH\/ndi_document_app.json" }
]
},
"depends_on": [
{ "name": "vmspikefilteringparameters_id",
"value": 0
}
],
"binnedspikeratevm": {
"parameters": {
"vmspikefilteringparameters_id": 0,
"binsize": "0.030",
"vm_baseline_correction": "0",
"vm_baseline_correct_time": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
{ "definition": "$NDIDOCUMENTPATH\/ndi_document_app.json" }
]
},
"depends_on":[
{ "name": "fit_input_id",
"value": 0
}
],
"vmspikefit": {
"fit_input_document_id": 0,
"fit_name": 0,
"fit_equation": 0,
"fit_parameters": 0,
Expand Down
2 changes: 1 addition & 1 deletion ndi_common/database_documents/data/fitcurve.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}
],
"fit_data": {
"exampledata_document_id": 0,
"exampledata_id": 0,
"input_data_field": "mydocumenttype.x",
"output_data_field": "mydocumenttype.y",
"output_number_examples": 20
Expand Down
4 changes: 2 additions & 2 deletions ndi_common/database_documents/ndi_document.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"superclasses": [ ]
},
"ndi_document": {
"experiment_unique_reference": "",
"document_unique_reference": "",
"experiment_id": "",
"document_id": "",
"name": "",
"type": "",
"datestamp": "2018-12-05T18:36:47.241Z",
Expand Down
2 changes: 1 addition & 1 deletion ndi_common/database_documents/ndi_document_subject.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"subject": {
"identifier": "",
"reference": "",
"species": "",
"strain": "",
"variant": ""
Expand Down
6 changes: 5 additions & 1 deletion ndi_common/database_documents/ndi_document_thing_epoch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
{ "definition": "$NDIDOCUMENTPATH\/data\/ndi_document_binaryseries.json" }
]
},
"depends_on": [
{ "name": "thing_id",
"value": ""
}
],
"thing_epoch": {
"thing_unique_reference": "",
"epoch_clock": "",
"t0_t1": ""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json" }
]
},
"thingreference": {
"thing_unique_id": []
"thing_id": {
"thing_id": []
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"document_class": {
"definition": "$NDIDOCUMENTPATH\/stimulus\/.json",
"validation": "$NDISCHEMAPATH\/stimulus\/.json",
"class_name": "ndi_document_control_stim_ids",
"class_version": 1,
"superclasses": [
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"}
]
},
"depends_on": [
{ "name": "stimulus_presentation_id",
"value": []
}
],
"control_stimids": {
"control_stimids": []
},
"control_stimid_method": {
}
}

Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
{
"document_class": {
"definition": "$NDIDOCUMENTPATH\/stimulus\/ndi_document_stimulus_response.json",
"validation": "$NDISCHEMAPATH\/stimulus\/ndi_document_stimulus_response_schema.json",
"class_name": "stimulus-ndi_document_stimulus_response",
"definition": "$NDIDOCUMENTPATH\/stimulus\/.json",
"validation": "$NDISCHEMAPATH\/stimulus\/_schema.json",
"class_name": "stimulus-",
"class_version": 1,
"superclasses": [
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"},
{ "definition": "$NDIDOCUMENTPATH\/ndi_document_thingreference.json"}
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"}
]
},
"depends_on": [
{ "name": "thing_id",
"value": []
},
{ "name": "stimulator_id",
"value": []
},
{ "name": "stimulus_presentation_document_id",
"value": []
},
{ "name": "stimulus_control_document_id",
"value": []
}
],
"stimulus_response": {
"stimulator_unique_reference": [],
"stimulator_epochid": [],
"thing_epochid": [],
"stimulus_presentation_document_identifier": [],
"stimulus_control_document_identifier": []
"thing_epochid": []
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@
"validation": "$NDISCHEMAPATH\/stimulus\/ndi_document_stimulus_response_scalar_schema.json",
"class_name": "stimulus-ndi_document_stimulus_response_scalar",
"class_version": 1,
"superclasses": [
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"},
{ "definition": "$NDIDOCUMENTPATH\/stimulus\/ndi_document_stimulus_response.json"}
"superclasses": [
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json" },
{ "definition": "$NDIDOCUMENTPATH\/stimulus\/ndi_document_stimulus_response.json"}
]
},
"depends_on": [
{ "name": "stimulus_response_scalar_parameters_id",
"value": ""
}
],
"stimulus_response_scalar": {
"stimulus_response_scalar_parameters_identifier": [],
"response_type": [],
"responses": {
"stimid": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"}
]
},
"stimulus_response_scalar_reference": []
"stimulus_response_scalar_id": []
}

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,17 @@
"class_name": "stimulus-ndi_document_stimulus_tuningcurve",
"class_version": 1,
"superclasses": [
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json" },
{ "definition": "$NDIDOCUMENTPATH\/ndi_document_thingreference.json" },
{ "definition": "$NDIDOCUMENTPATH\/stimulus\/ndi_document_stimulus_response_scalar_reference.json" }
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json" }
]
},
"depends_on": [
{ "name": "thing_id",
"value": ""
},
{ "name": "stimulus_response_scalar_id",
"value": ""
}
],
"tuning_curve": {
"independent_variable_label": [[]],
"independent_variable_value": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
"class_name": "oridir-ndi_document_orientation_direction_tuning",
"class_version": 1,
"superclasses": [
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"},
{ "definition": "$NDIDOCUMENTPATH\/ndi_document_thingreference.json"},
{ "definition": "$NDIDOCUMENTPATH\/stimulus\/ndi_document_stimulus_tuningcurve_reference.json"}
{ "definition": "$NDIDOCUMENTPATH\/ndi_document.json"}
]
},
"depends_on": [
{ "name": "thing_id",
"value": "" }
],
"orientation_direction_tuning": {
"properties": {
"coordinates": "compass",
Expand Down Expand Up @@ -42,8 +44,8 @@
"dot_direction_significance": 1
},
"fit": {
"double_gaussian_parameters": 0,
"double_gaussian_fit_angles": 0,
"double_gaussian_parameters": [0],
"double_gaussian_fit_angles": [0],
"double_gaussian_fit_values": [0],
"orientation_preferred_orthogonal_ratio": [0],
"direction_preferred_null_ratio": [0],
Expand Down
49 changes: 49 additions & 0 deletions test/database/test_ndi_document_jsons.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
function [b, successes, failures] = test_ndi_document_jsons(generate_error)
% TEST_NDI_DOCUMNET_JSONS - test validity of all NDI_DOCUMENT json definitions
%
% [B, SUCCESSES, FAILURES] = TEST_NDI_DOCUMENT_JSONS(GENERATE_ERROR)
%
% Tries to make a blank NDI_DOCUMENT from all NDI_DOCUMENT JSON definitions.
% Returns a cell array of all JSON file names that were successfully created in
% SUCCESSES, and a cell array of JSON file names there unsuccessfully created in
% FAILURES. B is 1 if all ndi documents were created successfully.
%
% If GENERATE_ERROR is present and is 1, then an error is generated if B is 0.
%

if nargin<1,
generate_error = 0;
end;

b = 0;
successes = {};
failures = {};

ndi_globals;

json_docs = findfilegroups(ndidocumentpath,{'.*\.json\>'});

for i=1:numel(json_docs),
[parentdir,filename,ext] = fileparts(json_docs{i}{1});
ndidoc = [filename ext];

if filename(1)=='.', % ignore swap files and hidden files
continue;
end;
try,
mydoc = ndi_document(ndidoc);
successes{end+1} = ndidoc;
catch,
failures{end+1} = ndidoc;
end;
end;

b = isempty(failures);

if generate_error & ~b,
disp(['NDI_DOCUMENT definitions failed']);
failures'
error(['At least one ndi_document failed to be built from its definition.']);
end;


1 change: 1 addition & 0 deletions test/testsuite/ndi_testsuite_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build_intan_flat_exp 1 Tests saving experiment parameters, documents
test_sg_flat 1 Tests reading from SpikeGadgets ndi_daqsystem_mfdaq_sg
test_ndi_probe 1 Tests basic probe functions
test_ndi_thing 1 Test basic nsd_thing functions
test_ndi_document_jsons 1 Test ability to make an NDI_DOCUMENT out of all JSON definitions
test_ndi_device_image_tiffstack 0 Not in current testing stream
test_ndi_image_tiffstack_multipleepoch 0 Not in current testing stream
test_ndi_filenavigator_fileIDfunction 0 Note in current testing stream

0 comments on commit ccbf6e8

Please sign in to comment.