diff --git a/src/pynwb/data/nwb.base.yaml b/src/pynwb/data/nwb.base.yaml index 2f4e62e8c..14ed915c5 100644 --- a/src/pynwb/data/nwb.base.yaml +++ b/src/pynwb/data/nwb.base.yaml @@ -38,7 +38,7 @@ datasets: value: indexes into a list of values for a list of elements default_name: vector_index shape: - - + - null - neurodata_type_def: ElementIdentifiers neurodata_type_inc: NWBData dtype: int @@ -50,7 +50,7 @@ datasets: value: unique identifiers for a list of elements default_name: element_id shape: - - + - null groups: - neurodata_type_def: NWBContainer doc: The attributes specified here are included in all interfaces. @@ -98,7 +98,7 @@ groups: - num_times quantity: '?' shape: - - + - null - name: control_description dtype: text doc: 'Description of each control value. COMMENT: Array length should be as long @@ -108,7 +108,7 @@ groups: - num_control_values quantity: '?' shape: - - + - null - name: data doc: 'Data values. Can also store binary data (eg, image frames) COMMENT: This field may be a link to data stored in an external file, especially in the case @@ -137,7 +137,7 @@ groups: dims: - num_times shape: - - + - null - name: starting_time dtype: float64 doc: 'The timestamp of the first sample. COMMENT: When timestamps are uniformly @@ -170,7 +170,7 @@ groups: - num_times quantity: '?' shape: - - + - null groups: - name: sync doc: 'Lab specific time and sync information as provided directly from hardware @@ -245,7 +245,7 @@ groups: doc: The names of the columns in this table. This should be used to specifying an order to the columns shape: - - + - null - name: description dtype: text doc: Description of what is in this dynamic table @@ -255,7 +255,7 @@ groups: dtype: int doc: The unique identifier for the rows in this dynamic table shape: - - + - null - neurodata_type_inc: TableColumn doc: The columns in this dynamic table quantity: '*' diff --git a/src/pynwb/data/nwb.behavior.yaml b/src/pynwb/data/nwb.behavior.yaml index 5417445b0..f92a62693 100644 --- a/src/pynwb/data/nwb.behavior.yaml +++ b/src/pynwb/data/nwb.behavior.yaml @@ -24,18 +24,18 @@ groups: attributes: - name: unit dtype: text - doc: 'The base unit of measure used to store data. This should be in the SI - unit. COMMENT: This is the SI unit (when appropriate) of the stored data, - such as Volts. If the actual data is stored in millivolts, the field ''conversion'' - below describes how to convert the data to the specified SI unit.' + doc: "The base unit of measure used to store data. This should be in the SI\ + \ unit. COMMENT: This is the SI unit (when appropriate) of the stored data,\ + \ such as Volts. If the actual data is stored in millivolts, the field 'conversion'\ + \ below describes how to convert the data to the specified SI unit." default_value: meter required: false dims: - num_times - num_features shape: - - - - + - null + - null - name: reference_frame dtype: text doc: Description defining what exactly 'straight-ahead' means. diff --git a/src/pynwb/data/nwb.ecephys.yaml b/src/pynwb/data/nwb.ecephys.yaml index a95fb22e4..f70b5d04f 100644 --- a/src/pynwb/data/nwb.ecephys.yaml +++ b/src/pynwb/data/nwb.ecephys.yaml @@ -84,9 +84,9 @@ groups: - - num_times - num_channels shape: - - - - - - - - + - - null + - - null + - null - neurodata_type_inc: ElectrodeTableRegion name: electrodes doc: the electrodes that this series was generated from @@ -124,11 +124,11 @@ groups: - num_channels - num_samples shape: - - - - - - - - - - - - + - - null + - null + - - null + - null + - null - neurodata_type_def: ClusterWaveforms neurodata_type_inc: NWBDataInterface doc: 'The mean waveform shape, including standard deviation, of the different clusters. @@ -157,8 +157,8 @@ groups: - num_clusters - num_samples shape: - - - - + - null + - null - name: waveform_sd dtype: float32 doc: Stdev of waveforms for each cluster, using the same indices as in mean @@ -166,8 +166,8 @@ groups: - num_clusters - num_samples shape: - - - - + - null + - null links: - name: clustering_interface doc: HDF5 link to Clustering interface that was the source of the clustered data @@ -195,7 +195,7 @@ groups: dims: - num_events shape: - - + - null - name: peak_over_rms dtype: float32 doc: Maximum ratio of waveform peak to RMS on any channel in the cluster (provides @@ -203,7 +203,7 @@ groups: dims: - num_clusters shape: - - + - null - name: times dtype: float64 doc: Times of clustered events, in seconds. This may be a link to times field @@ -211,7 +211,7 @@ groups: dims: - num_events shape: - - + - null default_name: Clustering - neurodata_type_def: FeatureExtraction neurodata_type_inc: NWBDataInterface @@ -229,7 +229,7 @@ groups: dims: - num_features shape: - - + - null - name: features dtype: float32 doc: Multi-dimensional array of features extracted from each event. @@ -238,16 +238,16 @@ groups: - num_channels - num_features shape: - - - - - - + - null + - null + - null - name: times dtype: float64 doc: Times of events that features correspond to (can be a link). dims: - num_events shape: - - + - null - neurodata_type_inc: ElectrodeTableRegion name: electrodes doc: the electrodes that this series was generated from @@ -274,7 +274,7 @@ groups: dims: - num_events shape: - - + - null - name: times dtype: float64 doc: Timestamps of events, in Seconds @@ -287,7 +287,7 @@ groups: dims: - num_events shape: - - + - null links: - name: source_electricalseries doc: HDF5 link to ElectricalSeries that this data was calculated from. Metadata diff --git a/src/pynwb/data/nwb.file.yaml b/src/pynwb/data/nwb.file.yaml index 4d3fc5bf1..a1b14003d 100644 --- a/src/pynwb/data/nwb.file.yaml +++ b/src/pynwb/data/nwb.file.yaml @@ -24,7 +24,7 @@ groups: dims: - '*unlimited*' shape: - - + - null - name: identifier dtype: text doc: 'A unique text identifier for the file. COMMENT: Eg, concatenated lab name, @@ -255,7 +255,7 @@ groups: dims: - num_namespaces shape: - - + - null quantity: '*' quantity: '?' - neurodata_type_def: Subject diff --git a/src/pynwb/data/nwb.icephys.yaml b/src/pynwb/data/nwb.icephys.yaml index 6764791d4..1ed06d247 100644 --- a/src/pynwb/data/nwb.icephys.yaml +++ b/src/pynwb/data/nwb.icephys.yaml @@ -18,7 +18,7 @@ groups: dims: - num_times shape: - - + - null - name: gain dtype: float doc: 'Units: Volt/Amp (v-clamp) or Volt/Volt (c-clamp)' diff --git a/src/pynwb/data/nwb.image.yaml b/src/pynwb/data/nwb.image.yaml index 964b12bfe..cb563caa8 100644 --- a/src/pynwb/data/nwb.image.yaml +++ b/src/pynwb/data/nwb.image.yaml @@ -31,15 +31,15 @@ groups: - y - x shape: - - - - - - - - - - - - - - - - - - - - - + - - null + - null + - - null + - null + - null + - - null + - null + - null + - null - name: dimension dtype: int32 doc: Number of pixels on x, y, (and z) axes. @@ -47,7 +47,7 @@ groups: - rank quantity: '?' shape: - - + - null - name: external_file dtype: text doc: 'Path or URL to one or more external file(s). Field only present if format=external. @@ -64,12 +64,12 @@ groups: dims: - num_files shape: - - + - null dims: - num_files quantity: '?' shape: - - + - null - name: format dtype: text doc: Format of image. If this is 'external' then the field external_file contains @@ -149,7 +149,7 @@ groups: dims: - num_times shape: - - + - null links: - name: indexed_timeseries doc: HDF5 link to TimeSeries containing images that are indexed. diff --git a/src/pynwb/data/nwb.misc.yaml b/src/pynwb/data/nwb.misc.yaml index 57d077f79..4decca683 100644 --- a/src/pynwb/data/nwb.misc.yaml +++ b/src/pynwb/data/nwb.misc.yaml @@ -33,8 +33,8 @@ groups: - num_times - num_features shape: - - - - + - null + - null - name: feature_units dtype: text doc: Units of each feature. @@ -42,14 +42,14 @@ groups: - num_features quantity: '?' shape: - - + - null - name: features dtype: text doc: Description of the features represented in TimeSeries::data. dims: - num_features shape: - - + - null - neurodata_type_def: AnnotationSeries neurodata_type_inc: TimeSeries doc: Stores, eg, user annotations made during an experiment. The TimeSeries::data[] @@ -77,7 +77,7 @@ groups: dims: - num_times shape: - - + - null - neurodata_type_def: IntervalSeries neurodata_type_inc: TimeSeries doc: Stores intervals of data. The timestamps field stores the beginning and end @@ -108,7 +108,7 @@ groups: dims: - num_times shape: - - + - null - neurodata_type_def: UnitTimes neurodata_type_inc: NWBDataInterface doc: Event times of observed units (e.g. cell, synapse, etc.). The UnitTimes group diff --git a/src/pynwb/data/nwb.ogen.yaml b/src/pynwb/data/nwb.ogen.yaml index 4726188e4..9c54c2f85 100644 --- a/src/pynwb/data/nwb.ogen.yaml +++ b/src/pynwb/data/nwb.ogen.yaml @@ -23,7 +23,7 @@ groups: dims: - num_times shape: - - + - null links: - name: site doc: link to OptogeneticStimulusSite group that describes the site to which this diff --git a/src/pynwb/data/nwb.ophys.yaml b/src/pynwb/data/nwb.ophys.yaml index 5593c84a3..17002f326 100644 --- a/src/pynwb/data/nwb.ophys.yaml +++ b/src/pynwb/data/nwb.ophys.yaml @@ -13,9 +13,9 @@ datasets: - num_x - num_y shape: - - - - - - + - null + - null + - null - neurodata_type_def: PixelMasks neurodata_type_inc: VectorData dtype: @@ -121,8 +121,8 @@ groups: - num_times - num_ROIs shape: - - - - + - null + - null - neurodata_type_inc: ROITableRegion name: rois doc: a dataset referencing into an ROITable containing information on the ROIs @@ -263,8 +263,8 @@ groups: - weight - x|y|z shape: - - - - + - null + - null - 3 - name: reference_frame dtype: text diff --git a/src/pynwb/data/nwb.retinotopy.yaml b/src/pynwb/data/nwb.retinotopy.yaml index a5cce3ab8..48fcf03b2 100644 --- a/src/pynwb/data/nwb.retinotopy.yaml +++ b/src/pynwb/data/nwb.retinotopy.yaml @@ -25,14 +25,14 @@ groups: dims: - row_col shape: - - + - null - name: field_of_view dtype: float doc: Size of viewing area, in meters dims: - row|column shape: - - + - null - name: unit dtype: text doc: Unit that axis data is stored in (e.g., degrees) @@ -40,8 +40,8 @@ groups: - num_rows - num_cols shape: - - - - + - null + - null - name: axis_1_power_map dtype: float32 doc: Power response on the first measured axis. Response is scaled so 0.0 is no @@ -54,14 +54,14 @@ groups: dims: - row_col shape: - - + - null - name: field_of_view dtype: float doc: Size of viewing area, in meters dims: - row_col shape: - - + - null - name: unit dtype: text doc: Unit that axis data is stored in (e.g., degrees) @@ -70,8 +70,8 @@ groups: - num_cols quantity: '?' shape: - - - - + - null + - null - name: axis_2_phase_map dtype: float32 doc: Phase response to stimulus on the second measured axis @@ -83,14 +83,14 @@ groups: dims: - row_col shape: - - + - null - name: field_of_view dtype: float doc: Size of viewing area, in meters dims: - row_col shape: - - + - null - name: unit dtype: text doc: Unit that axis data is stored in (e.g., degrees) @@ -98,8 +98,8 @@ groups: - num_rows - num_cols shape: - - - - + - null + - null - name: axis_2_power_map dtype: float32 doc: Power response on the second measured axis. Response is scaled so 0.0 is @@ -112,14 +112,14 @@ groups: dims: - row_col shape: - - + - null - name: field_of_view dtype: float doc: Size of viewing area, in meters dims: - row_col shape: - - + - null - name: unit dtype: text doc: Unit that axis data is stored in (e.g., degrees) @@ -128,8 +128,8 @@ groups: - num_cols quantity: '?' shape: - - - - + - null + - null - name: axis_descriptions dtype: text doc: Two-element array describing the contents of the two response axis fields. @@ -138,7 +138,7 @@ groups: dims: - '2' shape: - - + - null - name: focal_depth_image dtype: uint16 doc: 'Gray-scale image taken with same settings/parameters (e.g., focal depth, @@ -155,14 +155,14 @@ groups: dims: - row_col shape: - - + - null - name: field_of_view dtype: float doc: Size of viewing area, in meters dims: - row_col shape: - - + - null - name: focal_depth dtype: float doc: Focal depth offset, in meters @@ -173,8 +173,8 @@ groups: - num_rows - num_cols shape: - - - - + - null + - null - name: sign_map dtype: float32 doc: Sine of the angle between the direction of the gradient in axis_1 and axis_2 @@ -186,20 +186,20 @@ groups: dims: - row_col shape: - - + - null - name: field_of_view dtype: float doc: Size of viewing area, in meters. dims: - row_col shape: - - + - null dims: - num_rows - num_cols shape: - - - - + - null + - null - name: vasculature_image dtype: uint16 doc: 'Gray-scale anatomical image of cortical surface. Array structure: [rows][columns]' @@ -215,14 +215,14 @@ groups: dims: - row_col shape: - - + - null - name: field_of_view dtype: float doc: Size of viewing area, in meters dims: - row_col shape: - - + - null - name: format dtype: text doc: Format of image. Right now only 'raw' supported @@ -230,6 +230,6 @@ groups: - num_rows - num_cols shape: - - - - + - null + - null default_name: ImagingRetinotopy diff --git a/src/pynwb/form/spec/write.py b/src/pynwb/form/spec/write.py index 08eea0c90..dcb319058 100644 --- a/src/pynwb/form/spec/write.py +++ b/src/pynwb/form/spec/write.py @@ -52,6 +52,12 @@ def reorder_yaml(self, path): f_out.write(yaml.dump(sorted_data, Dumper=yaml.RoundTripDumper)) def sort_keys(self, obj): + + # Represent None as null + def my_represent_none(self, data): + return self.represent_scalar(u'tag:yaml.org,2002:null', u'null') + yaml.RoundTripRepresenter.add_representer(type(None), my_represent_none) + order = ['neurodata_type_def', 'neurodata_type_inc', 'name', 'dtype', 'doc', 'attributes', 'datasets', 'groups'] if isinstance(obj, dict):