Skip to content

Commit 8b88927

Browse files
committed
Update access_files.py
Updated code for consistency with documentation
1 parent 481641a commit 8b88927

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

EMGFlow-Package/src/EMGFlow/access_files.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def read_file_type(path, file_ext):
153153
Returns
154154
-------
155155
file : pd.DataFrame
156-
Returns a Pandas data frame of the file contents.
156+
Returns a Pandas dataframe of the file contents.
157157
158158
"""
159159

@@ -173,8 +173,8 @@ def read_file_type(path, file_ext):
173173

174174
def map_files(in_path, file_ext='csv', expression=None, base=None):
175175
"""
176-
Generate a dictionary of file names and locations from the subfiles of a
177-
folder.
176+
Generate a dictionary of file names and locations (keys/values) from the
177+
subfiles of a folder.
178178
179179
Parameters
180180
----------
@@ -192,7 +192,7 @@ def map_files(in_path, file_ext='csv', expression=None, base=None):
192192
Raises
193193
------
194194
Exception
195-
An exception is raised if expression is not None or a valid regular
195+
An exception is raised if 'expression' is not None or a valid regular
196196
expression.
197197
198198
Returns
@@ -240,7 +240,7 @@ def convert_map_files(file_obj, file_ext='csv', expression=None):
240240
241241
Parameters
242242
----------
243-
file_obj : str
243+
file_obj : str, dict-str
244244
The file location object. This can be a string to a file location, or
245245
an already formed dictionary of file locations.
246246
file_ext : str, optional
@@ -253,8 +253,7 @@ def convert_map_files(file_obj, file_ext='csv', expression=None):
253253
Raises
254254
------
255255
Exception
256-
An exception is raised if an unsupported file location format is
257-
provided.
256+
An exception is raised if 'file_ext' is an unsupported file format.
258257
Exception
259258
An exception is raised if 'expression' is not None or a valid regular
260259
expression.
@@ -307,10 +306,10 @@ def map_files_fuse(file_dirs, names):
307306
Parameters
308307
----------
309308
file_dirs : list-dict-str
310-
List of file location directories
309+
List of file location directories.
311310
names : list-str
312-
List of names to use for file directory columns. Same order as file
313-
directories.
311+
List of names to use for file directory columns. Same order as
312+
'file_dirs'.
314313
315314
Raises
316315
------
@@ -320,7 +319,7 @@ def map_files_fuse(file_dirs, names):
320319
321320
Returns
322321
-------
323-
pathDF : pd.DataFrame
322+
path_df : pd.DataFrame
324323
A dataframe of file names, and their locations in each file directory.
325324
326325
"""
@@ -339,7 +338,7 @@ def map_files_fuse(file_dirs, names):
339338
# Add row to data frame
340339
data.append(row)
341340
# Create data frame
342-
pathDF = pd.DataFrame(data, columns=['ID', 'File'] + names)
343-
pathDF.set_index('ID',inplace=True)
341+
path_df = pd.DataFrame(data, columns=['ID', 'File'] + names)
342+
path_df.set_index('ID',inplace=True)
344343

345-
return pathDF
344+
return path_df

0 commit comments

Comments
 (0)