Skip to content

Commit 5c3a4af

Browse files
committed
Standardize docstrings for improved clarity
Updated docstrings in convert_intervals.py, convert_rec_header.py, convert_yaml.py, and metadata_validation.py to use consistent formatting, capitalization, and parameter descriptions. This improves code readability and documentation quality.
1 parent 526931b commit 5c3a4af

File tree

4 files changed

+18
-22
lines changed

4 files changed

+18
-22
lines changed

src/trodes_to_nwb/convert_intervals.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,16 @@ def add_epochs(
2020
session_df: pd.DataFrame,
2121
neo_io: list[SpikeGadgetsRawIO],
2222
):
23-
"""add epochs to nwbfile
23+
"""Add epochs to nwbfile.
2424
2525
Parameters
2626
----------
2727
nwbfile : NWBFile
28-
nwbfle to add epochs to
29-
file_info : pd.DataFrame
30-
dataframe with file info
31-
date : int
32-
date of session
33-
animal : str
34-
animal name
35-
neo_io: List[SpikeGadgetsRawIO]
36-
neo_io iterators for each rec file. Contains time information
28+
NWB file to add epochs to.
29+
session_df : pd.DataFrame
30+
DataFrame with session file information.
31+
neo_io : list[SpikeGadgetsRawIO]
32+
List of neo_io iterators for each rec file. Contains time information.
3733
"""
3834
logger = logging.getLogger("convert")
3935
for epoch in set(session_df.epoch):

src/trodes_to_nwb/convert_rec_header.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212

1313

1414
def read_header(recfile: Path | str) -> ElementTree.Element:
15-
"""Read xml header from rec file
15+
"""Read XML header from rec file.
1616
1717
Parameters
1818
----------
19-
recfile : Path
20-
Path to rec file
19+
recfile : Path or str
20+
Path to rec file.
2121
2222
Returns
2323
-------
2424
ElementTree.Element
25-
xml header
25+
XML header element.
2626
2727
Raises
2828
------
2929
ValueError
30-
If the xml header does not contain '</Configuration>'
30+
If the XML header does not contain '</Configuration>'.
3131
"""
3232
header_size = None
3333
with open(recfile, mode="rb") as f:

src/trodes_to_nwb/convert_yaml.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ def load_metadata(
3333
metadata_path: str,
3434
device_metadata_paths: list[str],
3535
) -> tuple[dict, list[dict]]:
36-
"""loads metadata files as dictionaries
36+
"""Loads metadata files as dictionaries.
3737
3838
Parameters
3939
----------
4040
metadata_path : str
41-
path to file made by yaml generator
41+
Path to file made by yaml generator.
4242
device_metadata_paths : list[str]
43-
list of paths to yaml files with information on standard devices (e.g. probes,
44-
optical fibers, viruses)
43+
List of paths to yaml files with information on standard devices (e.g. probes,
44+
optical fibers, viruses).
4545
4646
Returns
4747
-------
4848
tuple[dict, list[dict]]
49-
the yaml generator metadata and list of device metadatas
49+
The yaml generator metadata and list of device metadatas.
5050
"""
5151
metadata = None
5252
with open(metadata_path) as stream:

src/trodes_to_nwb/metadata_validation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212

1313
def _get_nwb_json_schema_path() -> str:
14-
"""Get the NWB JSON Schema file path
14+
"""Get the NWB JSON Schema file path.
1515
1616
Returns
1717
-------
1818
str
19-
NWB Schema file Path
19+
NWB Schema file path.
2020
"""
2121
return str((Path(__file__).parent / "nwb_schema.json").resolve())
2222

0 commit comments

Comments
 (0)