From 4b31571e924258bc484516e7806b0fa089650bd9 Mon Sep 17 00:00:00 2001 From: Miles Wells Date: Mon, 21 Oct 2024 16:51:09 +0300 Subject: [PATCH] typing; docstring formatting --- iblutil/io/jsonable.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/iblutil/io/jsonable.py b/iblutil/io/jsonable.py index b965023..6a1a4fe 100644 --- a/iblutil/io/jsonable.py +++ b/iblutil/io/jsonable.py @@ -1,5 +1,4 @@ import json -from pathlib import Path from typing import Any, List, Tuple import pandas as pd @@ -27,20 +26,23 @@ def append(file, data): _write(file, data, 'a') -def load_task_jsonable(jsonable_file: str | Path, offset: int | None = None) -> Tuple[pd.DataFrame, List[Any]]: +def load_task_jsonable(jsonable_file, offset: int = None) -> Tuple[pd.DataFrame, List[Any]]: """ Reads in a task data jsonable file and returns a trials dataframe and a bpod data list. Parameters ---------- - - jsonable_file (str): full path to jsonable file. - - offset (int or None): The offset to start reading from (default: None). + jsonable_file : str, pathlib.Path + Full path to jsonable file. + offset : int + The offset to start reading from (default: None). Returns ------- - - tuple: A tuple containing: - - trials_table (pandas.DataFrame): A DataFrame with the trial info in the same format as the Session trials table. - - bpod_data (list): timing data for each trial + pandas.DataFrame + A DataFrame with the trial info in the same format as the Session trials table. + list + Timing data for each trial. """ trials_table = [] with open(jsonable_file) as f: