Skip to content

Commit e6a4ab1

Browse files
hange the docstring of this function
1 parent 5514104 commit e6a4ab1

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

kielmat/utils/importers.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,21 @@
99

1010
def import_axivity(file_path: str, tracked_point: str) -> tuple[pd.DataFrame, pd.DataFrame]:
1111
"""
12-
Imports Axivity data from the specified file path and
13-
return the data and channel formatted to be used in a KielMATRecording object.
12+
Imports and processes data from an Axivity device file.
1413
1514
Args:
16-
file_path (str or Path): The path to the Axivity data file.
17-
tracked_point (str): The name of the tracked point.
15+
file_path (str): Path to the Axivity data file.
16+
tracked_point (str): Label for the tracked body point (e.g., 'wrist').
1817
1918
Returns:
20-
dict, dict: The loaded data and channels as dictionaries.
19+
tuple[pd.DataFrame, pd.DataFrame]: A tuple containing:
20+
- data (pd.DataFrame): Processed accelerometer data with time information.
21+
- channels (pd.DataFrame): Channel information DataFrame with metadata such as
22+
component, type, units, and sampling frequency.
2123
22-
Examples:
23-
>>> file_path = "/path/to/axivity_data.cwa"
24-
>>> tracked_point = "lowerBack"
25-
>>> data, channels = import_axivity(file_path, tracked_point)
24+
Raises:
25+
ValueError: If no tracked point is provided.
2626
"""
27-
2827
# return an error if no tracked point is provided
2928
if not tracked_point:
3029
raise ValueError("Please provide a tracked point.")
@@ -73,20 +72,21 @@ def import_mobilityLab(
7372
tracked_points: str | list[str],
7473
) -> tuple[pd.DataFrame, pd.DataFrame]:
7574
"""
76-
Imports data from an APDM Mobility Lab system from the specified file path.
75+
Imports and processes data from an APDM Mobility Lab system file.
7776
7877
Args:
79-
file_name (str or Path): The absolute or relative path to the data file.
80-
tracked_points (str or list of str]):
81-
Defines for which tracked points data are to be returned.
78+
file_name (str | Path): Path to the Mobility Lab HDF5 file.
79+
tracked_points (str | list[str]): Name or list of names for tracked body points to import.
8280
8381
Returns:
84-
dict, dict: The loaded data and channels as dictionaries.
85-
86-
Examples:
87-
>>> file_path = "/path/to/sensor_data.h5"
88-
>>> tracked_points = "Lumbar"
89-
>>> recording = import_mobilityLab(file_path, tracked_points)
82+
tuple[pd.DataFrame, pd.DataFrame]: A tuple containing:
83+
- data (pd.DataFrame): DataFrame with combined accelerometer, gyroscope,
84+
and magnetometer data for each tracked point.
85+
- channels (pd.DataFrame): DataFrame containing metadata, including sensor name,
86+
component, type, units, and sampling frequency.
87+
88+
Raises:
89+
ValueError: If any specified tracked point does not exist in the file's monitor labels.
9090
"""
9191
# Convert file_name to a Path object if it is a string
9292
if isinstance(file_name, str):

0 commit comments

Comments
 (0)