@@ -36,7 +36,10 @@ def __init__(self, file, file_type=None, worksheet_name=None, has_column_names=T
3636 name (str or None): Optional field for how this file will report errors.
3737 allow_blank_names(bool): If True, column names can be blank
3838
39- :raises HedFileError:
39+ Raises:
40+ HedFileError: For various issues.
41+
42+ Notes: Reasons for raising HedFileError include:
4043 - file is blank.
4144 - An invalid dataframe was passed with size 0.
4245 - An invalid extension was provided.
@@ -96,7 +99,8 @@ def dataframe_a(self) ->pd.DataFrame:
9699 """Return the assembled dataframe Probably a placeholder name.
97100
98101 Returns:
99- pd.Dataframe: the assembled dataframe"""
102+ pd.Dataframe: the assembled dataframe
103+ """
100104 return self .assemble ()
101105
102106 @property
@@ -114,7 +118,7 @@ def series_filtered(self) -> Union[pd.Series, None]:
114118 """Return the assembled dataframe as a series, with rows that have the same onset combined.
115119
116120 Returns:
117- Union[pd.Series, None] the assembled dataframe with columns merged, and the rows filtered together.
121+ Union[pd.Series, None]: the assembled dataframe with columns merged, and the rows filtered together.
118122 """
119123 if self .onsets is not None :
120124 return filter_series_by_onset (self .series_a , self .onsets )
@@ -210,11 +214,9 @@ def to_excel(self, file):
210214 Parameters:
211215 file (str or file-like): Location to save this base input.
212216
213- :raises ValueError:
214- - If empty file object was passed.
215-
216- :raises OSError:
217- - Cannot open the indicated file.
217+ Raises:
218+ ValueError: If empty file object was passed.
219+ OSError: If the file cannot be opened.
218220 """
219221 if not file :
220222 raise ValueError ("Empty file name or object passed in to BaseInput.save." )
@@ -242,11 +244,12 @@ def to_csv(self, file=None):
242244
243245 Parameters:
244246 file (str, file-like, or None): Location to save this file. If None, return as string.
247+
245248 Returns:
246249 None or str: None if file is given or the contents as a str if file is None.
247250
248- :raises OSError :
249- - Cannot open the indicated file.
251+ Raises :
252+ OSError: If the file cannot be opened .
250253 """
251254 dataframe = self ._dataframe
252255 csv_string_if_filename_none = dataframe .to_csv (file , sep = '\t ' , index = False , header = self ._has_column_names )
@@ -259,7 +262,7 @@ def columns(self):
259262 Empty if no column names.
260263
261264 Returns:
262- columns( list) : The column names.
265+ list: The column names.
263266 """
264267 columns = []
265268 if self ._dataframe is not None and self ._has_column_names :
@@ -288,14 +291,10 @@ def set_cell(self, row_number, column_number, new_string_obj, tag_form="short_ta
288291 Notes:
289292 Any attribute of a HedTag that returns a string is a valid value of tag_form.
290293
291- :raises ValueError:
292- - There is not a loaded dataframe.
293-
294- :raises KeyError:
295- - The indicated row/column does not exist.
296-
297- :raises AttributeError:
298- - The indicated tag_form is not an attribute of HedTag.
294+ Raises:
295+ ValueError: If there is not a loaded dataframe.
296+ KeyError: If the indicated row/column does not exist.
297+ AttributeError: If the indicated tag_form is not an attribute of HedTag.
299298 """
300299 if self ._dataframe is None :
301300 raise ValueError ("No data frame loaded" )
@@ -315,8 +314,8 @@ def get_worksheet(self, worksheet_name=None) -> Union[openpyxl.workbook.Workbook
315314 Notes:
316315 If None, returns the first worksheet.
317316
318- :raises KeyError :
319- - The specified worksheet name does not exist.
317+ Raises :
318+ KeyError: If the specified worksheet name does not exist.
320319 """
321320 if worksheet_name and self ._loaded_workbook :
322321 # return self._loaded_workbook.get_sheet_by_name(worksheet_name)
@@ -380,6 +379,7 @@ def assemble(self, mapper=None, skip_curly_braces=False) ->pd.DataFrame:
380379 Parameters:
381380 mapper (ColumnMapper or None): Generally pass none here unless you want special behavior.
382381 skip_curly_braces (bool): If True, don't plug in curly brace values into columns.
382+
383383 Returns:
384384 pd.Dataframe: The assembled dataframe.
385385 """
0 commit comments