Skip to content

Commit 665f7c8

Browse files
committed
type hinting
1 parent 825cef3 commit 665f7c8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

mtpy/processing/run_summary.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ def __repr__(self):
8787
return self.__str__()
8888

8989
@property
90-
def df(self):
90+
def df(self) -> pd.DataFrame:
9191
return self._df
9292

9393
@df.setter
94-
def df(self, value):
94+
def df(self, value: pd.DataFrame):
9595
"""
9696
Make sure the data frame is set properly with proper column names
9797
@@ -129,7 +129,7 @@ def clone(self):
129129
"""
130130
return copy.deepcopy(self)
131131

132-
def from_mth5s(self, mth5_list):
132+
def from_mth5s(self, mth5_list) -> list:
133133
"""Iterates over mth5s in list and creates one big dataframe
134134
summarizing the runs
135135
"""
@@ -146,16 +146,16 @@ def _warn_no_data_runs(self):
146146
logger.info("To drop no data runs use `drop_no_data_rows`")
147147

148148
@property
149-
def mini_summary(self):
149+
def mini_summary(self) -> pd.DataFrame:
150150
"""shows the dataframe with only a few columns for readbility"""
151151
return self.df[self._mini_summary_columns]
152152

153153
@property
154-
def print_mini_summary(self):
154+
def print_mini_summary(self) -> str:
155155
"""Calls minisummary through logger so it is formatted."""
156156
logger.info(self.mini_summary)
157157

158-
def drop_no_data_rows(self):
158+
def drop_no_data_rows(self) -> bool:
159159
"""
160160
Drops rows marked `has_data` = False and resets the index of self.df
161161
@@ -190,7 +190,9 @@ def set_sample_rate(self, sample_rate: float, inplace: bool = False):
190190
return new_rs
191191

192192

193-
def extract_run_summary_from_mth5(mth5_obj, summary_type="run"):
193+
def extract_run_summary_from_mth5(
194+
mth5_obj, summary_type: Optional[str] = "run"
195+
):
194196
"""
195197
Given a single mth5 object, get the channel_summary and compress it to a
196198
run_summary.

0 commit comments

Comments
 (0)