From 1a9e729071fcda350ad7d9c6bfb60277e9e09848 Mon Sep 17 00:00:00 2001 From: Brandyn Lucca <=> Date: Thu, 8 Feb 2024 11:19:58 -0800 Subject: [PATCH] Added docstring to `stretch` function The previous commit/push missed the doc string defined for the `stretch` function. --- EchoPro/computation/operations.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/EchoPro/computation/operations.py b/EchoPro/computation/operations.py index 901a4c48..e71108c4 100644 --- a/EchoPro/computation/operations.py +++ b/EchoPro/computation/operations.py @@ -162,13 +162,25 @@ def stretch( dataframe , index_variables = [ 'transect_num' , 'latitude' , 'longitude' , 'stratum_num' ] , sep = "_" , suffix = "\\w+" ): - """_summary_ - - Args: - dataframe (_type_): _description_ + """ + Melts dataframe into a parseable format - Returns: - _type_: _description_ + Parameters + ---------- + dataframe: pd.DataFrame + A DataFrame object containing pertinent biological data + variable: str + Data variable name + variable_contrast: str + The name of the column that will be used to index the data variable + index_variables: str or List + A list or string of additional indexing/metadata variables that will be joined to the + data-of-interest + sep: str + A character indicating the separation of the variable names in the wide format, to be stripped + from the names in the long format + suffix: str + A regular expression capturing the wanted suffixes """ ### Ensure variables are a list in case input is just a str idx_lst = [ index_variables ] if isinstance( index_variables , str) else index_variables