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

Structure change #3

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Structure change #3

wants to merge 15 commits into from

Conversation

AlejandroMC28
Copy link

Changed structure of the package(added classes for food counts and food flows), added visualization, utilities and testing

@bittremieux bittremieux self-requested a review September 17, 2024 19:22
@bittremieux
Copy link
Member

Can you remove the __pycache__/ directories from the PR?

I recommend using a good global .gitignore file to avoid checking in such unnecessary files.

@AlejandroMC28
Copy link
Author

Removed cache files and added a .gitignore file

Copy link
Member

@bittremieux bittremieux left a comment

Choose a reason for hiding this comment

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

Nice work. I left a few comments to mainly update some of the code style a bit. Note that some of these comments re-occur in a few different places but I haven't marked all of them, so go through the code with them in mind.

gfop/analysis.py Outdated Show resolved Hide resolved
gfop/analysis.py Outdated Show resolved Hide resolved
gfop/analysis.py Outdated Show resolved Hide resolved
gfop/analysis.py Outdated Show resolved Hide resolved
gfop/analysis.py Outdated Show resolved Hide resolved
gfop/foodcounts.py Outdated Show resolved Hide resolved
gfop/foodflows.py Outdated Show resolved Hide resolved
gfop/notebooks/01_food_counts_notebook.ipynb Outdated Show resolved Hide resolved
gfop/utils.py Outdated Show resolved Hide resolved
gfop/visualization.py Outdated Show resolved Hide resolved
@AlejandroMC28
Copy link
Author

Resolved all comments, updated the base algorithm of food counts computation.

@bittremieux bittremieux self-requested a review October 8, 2024 18:41
Copy link
Member

@bittremieux bittremieux left a comment

Choose a reason for hiding this comment

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

The code is starting to look very nice, good job. I have one main concern, and that's the addition of several big(ish) sample files used for testing. This should ideally be avoided, see the comment in the code.

gfop/analysis.py Outdated
import pandas as pd
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from skbio.stats.composition import clr
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Alphabetical order.

"""
Generates a table of food counts at the filename level. It filters the GNPS network
based on the provided sample and
reference groups.
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Newlines fix.

- flows: DataFrame with source, target, and value columns.
- processes: DataFrame with process details.
"""
# Select GNPS job groups.
Copy link
Member

Choose a reason for hiding this comment

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

question: This first part repeats some behavior of the FoodCounts class. Can FoodFlows instead take a FoodCounts object as input on which these steps are already applied, and then only take care of the visualization?

# Standard library imports
import os
import pkg_resources
from importlib import resources
Copy link
Member

Choose a reason for hiding this comment

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

question: Not used?

# Standard library imports
import os
from typing import List, Optional, Union, Tuple
from importlib import resources
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Alphabetical order.


# Third-party imports
import matplotlib.pyplot as plt
import matplotlib.figure
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Alphabetical order.

# Third-party imports
import matplotlib.pyplot as plt
import matplotlib.figure
import seaborn as sns
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Alphabetical order.

import sys

# Third-party imports
import pytest
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Alphabetical order.

# Internal imports
from foodcounts import FoodCounts # type: ignore


Copy link
Member

Choose a reason for hiding this comment

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

nitpick: Too many blank lines.

tests/test_foodcounts.py Outdated Show resolved Hide resolved
@AlejandroMC28
Copy link
Author

Solved previous comments, and 8/11 issues. Issues remaining are to add changelog, documentation and contributing guidelines

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.

2 participants