Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display tract profiles grouped by var_interest #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pierre-nedelec
Copy link

@pierre-nedelec pierre-nedelec commented Feb 7, 2023

Prototype of generic function to display tract profiles, grouped by a variable of interest.

Todos:

  • write documentation/example, need @arokem or @richford feedback on where is best
  • review default settings
  • (optional) checks on input data

Copy link
Collaborator

@arokem arokem left a 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,
Copy link
Collaborator

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
Copy link
Collaborator

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:
Copy link
Collaborator

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?

Copy link
Collaborator

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
Copy link
Collaborator

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:
Copy link
Collaborator

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:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a docstring.

afqinsight/plot.py Show resolved Hide resolved
tractometry data
var_df : pd.DataFrame
dataframe with categorical or pseudocontinuous variable of interest
center_cut : bool, optional
Copy link
Collaborator

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?

afqinsight/plot.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants