diff --git a/src/trodes_to_nwb/convert_dios.py b/src/trodes_to_nwb/convert_dios.py index cdcac66..b316d70 100644 --- a/src/trodes_to_nwb/convert_dios.py +++ b/src/trodes_to_nwb/convert_dios.py @@ -25,7 +25,12 @@ def _get_channel_name_map(metadata: dict) -> dict[str, str]: raise ValueError( f"Duplicate channel name {dio_event['description']} in metadata YAML" ) - channel_name_map[dio_event["description"]] = dio_event["name"] + channel_name_map[dio_event["description"]] = { + "name": dio_event["name"], + "comments": ( + dio_event["comments"] if "comments" in dio_event else "no comments" + ), + } return channel_name_map @@ -88,7 +93,8 @@ def add_dios(nwbfile: NWBFile, recfile: list[str], metadata: dict) -> None: assert isinstance(timestamps[0], np.float64) assert isinstance(timestamps, np.ndarray) ts = TimeSeries( - name=channel_name_map[channel_name], + name=channel_name_map[channel_name]["name"], + comments=channel_name_map[channel_name]["comments"], description=channel_name, data=state_changes, unit="-1", # TODO change to "N/A", diff --git a/src/trodes_to_nwb/tests/test_data/20230622_sample_metadata.yml b/src/trodes_to_nwb/tests/test_data/20230622_sample_metadata.yml index e7d7544..ae24215 100644 --- a/src/trodes_to_nwb/tests/test_data/20230622_sample_metadata.yml +++ b/src/trodes_to_nwb/tests/test_data/20230622_sample_metadata.yml @@ -80,6 +80,7 @@ device: behavioral_events: - description: Din1 name: Light_1 + comments: Indicator for reward delivery - description: Din2 name: Light_2 - description: Dout2