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

FeatureRequest: Create ProfileData Class #327

Open
1 task done
kenibrewer opened this issue Oct 7, 2023 · 0 comments · May be fixed by #383
Open
1 task done

FeatureRequest: Create ProfileData Class #327

kenibrewer opened this issue Oct 7, 2023 · 0 comments · May be fixed by #383
Assignees
Labels
enhancement New feature or request

Comments

@kenibrewer
Copy link
Member

kenibrewer commented Oct 7, 2023

Feature type

  • Add new functionality

Story

As a pycytominer developer, I would like to have descriptive dataclasses to use when working on pycytominer's main functions. Instead of repetitively passing necessary attributes such as "feature_cols" and "metadata_cols" from function to function, I could pass a singluar descriptive dataclass with all the information about the dafarame needed to operate on it. This would allow me to write more modular, more easily tested code.

General description of the proposed functionality

As a first step to reducing the quantity of redundant code in Pycytominer, it would be good to create a ProfileData Class. This Class could contain methods that provide shared functionality used by all or most of the core pycytominer functions such how the data should be read from a file and determining what feature/metadata columns are.

Example pseudo-code

Class ProfilesData:
    ___init__(profiles, feature_cols, meta_cols,):
        self.profiles_df = pd.read_csv(input_csv)
        self.features_df = self.profiles_df[feature_cols]

    def aggregate_data(self, aggregate_on):

        self.profiles_df.group_by(aggregate_on) 


Additional information

This class should be initially provided as separate functionality, but gradually could integrated into the core functions (aggregate, normalize, annotate, etc. Ideally, this should be able to be accomplished without changing the functionality that users expect from those functions.

@kenibrewer kenibrewer added the enhancement New feature or request label Oct 7, 2023
@kenibrewer kenibrewer self-assigned this Oct 17, 2023
@kenibrewer kenibrewer linked a pull request Mar 25, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant