-
Notifications
You must be signed in to change notification settings - Fork 10
Display tract profiles grouped by var_interest #136
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great start! I have a few comments/suggestions.
Regarding documentation example -- I wonder if this couldn't be added to one of the existing examples here?
|
||
|
||
def plot_profiles_by_group( | ||
tracto_df:pd.DataFrame, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type annotations! We haven't done any of those yet, but it's a good step into the future!
tracto (pd.DataFrame): tractometry dataframe. | ||
|
||
Returns: | ||
pd.DataFrame: tractometry dataframe, with embelishments for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence seems to be curtailed.
|
||
|
||
|
||
def optimize(df:pd.DataFrame) -> pd.DataFrame: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function name is rather generic. What does "optimize" mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And please add a docstring
@@ -0,0 +1,152 @@ | |||
"""Utility functions to manipulate tractometry type dataframe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that these functions could be added to the existing "utils.py" file.
def center_cut(df: pd.DataFrame, cut: tuple=(25,75)) -> pd.DataFrame: | ||
""" Returns dataframe where the nodeID is cut between two indicated values. | ||
|
||
Args: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the numpy docstring standard (used in other functions you wrote) here as well.
sessions=1, | ||
tracts=2, | ||
) -> pd.DataFrame: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a docstring.
tractometry data | ||
var_df : pd.DataFrame | ||
dataframe with categorical or pseudocontinuous variable of interest | ||
center_cut : bool, optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can allow center_cut
to be a number between 0 and 1 that tells how much of the center to cut?
Prototype of generic function to display tract profiles, grouped by a variable of interest.
Todos: