You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@
11
11
* Add Plexon2 support [PR #918](https://github.com/catalystneuro/neuroconv/pull/918)
12
12
* Converter working with multiple VideoInterface instances [PR #914](https://github.com/catalystneuro/neuroconv/pull/914)
13
13
* Added helper function `neuroconv.tools.data_transfers.submit_aws_batch_job` for basic automated submission of AWS batch jobs. [PR #384](https://github.com/catalystneuro/neuroconv/pull/384)
14
+
* Data interfaces `run_conversion` method now performs metadata validation before running the conversion. [PR #949](https://github.com/catalystneuro/neuroconv/pull/949)
14
15
* Introduced `null_values_for_properties` to `add_units_table` to give user control over null values behavior [PR #989](https://github.com/catalystneuro/neuroconv/pull/989)
15
16
16
17
@@ -26,6 +27,7 @@
26
27
* The `DeeplabcutInterface` now skips inferring timestamps from movie when timestamps are specified, running faster. [PR #967](https://github.com/catalystneuro/neuroconv/pull/967)
27
28
* Improve metadata writing for SpikeGLX data interface. Added contact ids, shank ids and, remove references to shanks for neuropixels 1.0. Also deprecated the previous neuroconv exclusive property "electrode_shank_number` [PR #986](https://github.com/catalystneuro/neuroconv/pull/986)
28
29
* Add tqdm with warning to DeepLabCut interface [PR #1006](https://github.com/catalystneuro/neuroconv/pull/1006)
30
+
*`BaseRecordingInterface` now calls default metadata when metadata is not passing mimicking `run_conversion` behavior. [PR #1012](https://github.com/catalystneuro/neuroconv/pull/1012)
This will open the files and read header information, setting up the system for conversion,
40
+
but generally will not read the underlying data.
41
+
41
42
.. note::
42
43
43
44
To get the form of source_data, run :meth:`.BaseDataInterface.get_source_schema`,
44
45
which returns the :ref:`source schema <source_schema>` as a JSON-schema-like dictionary informing
45
46
the user of the required and optional input arguments to the downstream readers.
46
47
47
-
48
48
3. Get and adjust metadata
49
49
~~~~~~~~~~~~~~~~~~~~~~~~~~
50
50
Each ``DataInterface`` can extract relevant metadata from the source files and
51
-
organize it in a ``metadata`` hierarchical dictionary. This dictionary
52
-
can be edited to include data not available in the source files.
51
+
organize it in a ``metadata`` hierarchical dictionary:
53
52
54
53
.. code-block:: python
55
54
56
55
metadata = interface.get_metadata()
57
56
57
+
This dictionary can be edited to include data not available in the source files.
58
58
The DANDI Archive requires subject ID, sex, age, and species, which are rarely present in the source data. Here is how you would add them.
59
59
60
60
.. code-block:: python
@@ -75,14 +75,17 @@ The DANDI Archive requires subject ID, sex, age, and species, which are rarely p
75
75
- ``U`` for Unknown
76
76
- ``O`` for Other
77
77
78
-
``age`` follows the `ISO 8601 duration format <https://en.wikipedia.org/wiki/ISO_8601#Durations>`_. For example, ``P30D`` is 30 days old, and ``P1Y`` would be 1 year old. To express a range of ages, you can use a slash, for example ``P30D/P35D`` for 30 to 35 days old.
78
+
``age`` follows the `ISO 8601 duration format <https://en.wikipedia.org/wiki/ISO_8601#Durations>`_.
79
+
For example, ``P30D`` is 30 days old, and ``P1Y`` would be 1 year old.
80
+
To express a range of ages, you can use a slash, for example ``P30D/P35D`` for 30 to 35 days old.
79
81
80
82
``species`` is the scientific Latin binomial name of the species. For example, ``Mus musculus``
81
83
for a mouse.
82
84
83
-
See :ref:`Subject Best Practices <best_practice_subject_exists>` for details
85
+
See :ref:`Subject Best Practices <best_practice_subject_exists>` for details.
84
86
85
-
The ``session_start_time`` is also required. This is sometimes found in the source data. If it is not found, you must add it.
87
+
The ``session_start_time`` is also required. This is sometimes found in the source data.
88
+
If it is not found, you must add it:
86
89
87
90
.. code-block:: python
88
91
@@ -93,13 +96,15 @@ The ``session_start_time`` is also required. This is sometimes found in the sour
93
96
94
97
You can use ``tz.tzlocal()`` to get the local timezone.
95
98
96
-
If the ``session_start_time`` is extracted from the source data, it is often missing a timezone. This is not required but is a recommended best practice. Here is how you would add it.
99
+
If the ``session_start_time`` is extracted from the source data, it is often missing a timezone.
100
+
This is not required but is a recommended best practice. Here is how you would add it:
NWB Best Practices also recommends several other fields that are rarely present in the extracted metadata. The metadata dictionary is the place to add this information.
106
+
NWB Best Practices also recommends several other fields that are rarely present in the extracted metadata.
107
+
The metadata dictionary is the place to add this information:
103
108
104
109
.. code-block:: python
105
110
@@ -113,7 +118,9 @@ NWB Best Practices also recommends several other fields that are rarely present
113
118
keywords=["finches", "evolution", "Galapagos"],
114
119
)
115
120
116
-
The ``metadata`` dictionary also contains metadata that pertain to the specific data being converted. In this example, the ``Ecephys`` key contains metadata that pertains to the electrophysiology data being converted. This metadata can be edited in the same way.
121
+
The ``metadata`` dictionary also contains metadata that pertain to the specific data being converted.
122
+
In this example, the ``Ecephys`` key contains metadata that pertains to the electrophysiology data being converted.
123
+
This metadata can be edited in the same way:
117
124
118
125
.. code-block:: python
119
126
@@ -134,19 +141,22 @@ The ``metadata`` dictionary also contains metadata that pertain to the specific
134
141
'description': 'Name of the ElectrodeGroup this electrode is a part of.'},
135
142
{'name': 'contact_shapes', 'description': 'The shape of the electrode'}]}
136
143
137
-
Here we can see that ``metadata["Ecephys"]["ElectrodeGroup"][0]["location"]`` is ``unknown``. We can add this information as follows:
144
+
Here we can see that ``metadata["Ecephys"]["ElectrodeGroup"][0]["location"]`` is ``unknown``.
Use ``.get_metadata_schema()`` to get the schema of the metadata dictionary. This schema is a JSON-schema-like dictionary that specifies required and optional fields in the metadata dictionary. See :ref:`metadata schema <metadata_schema>` for more information.
152
+
Use ``.get_metadata_schema()`` to get the schema of the metadata dictionary.
153
+
This schema is a JSON-schema-like dictionary that specifies required and optional fields in the metadata dictionary.
154
+
See :ref:`metadata schema <metadata_schema>` for more information.
145
155
146
156
4a. Run conversion
147
157
~~~~~~~~~~~~~~~~~~
148
158
The ``.run_conversion`` method takes the (edited) metadata dictionary and
149
-
the path of an NWB file, and launches the actual data conversion into NWB.
159
+
the path of an NWB file, and launches the actual data conversion into NWB:
150
160
151
161
.. code-block:: python
152
162
@@ -162,21 +172,24 @@ the file size of the output NWB file and optimizing the file for cloud compute.
162
172
163
173
4b. Create an in-memory NWB file
164
174
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
165
-
If you want to create an in-memory NWB file, you can use the ``.create_nwbfile`` method.
0 commit comments