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

Enhance input validation, CLI functionality, and testing for directLFQ #39

Merged
merged 12 commits into from
Aug 13, 2024

Conversation

ammarcsj
Copy link
Member

This PR adds duplicate row handling, fixes a non-functional CLI option, expands quicktests with a CLI run, updates GitHub Actions workflows, and bumps the version to 0.2.20.

  • Duplicates in input
    • Added a check to raise an error when duplicate rows exist in the input dataframe
    • Implemented removal of potential duplicate quant_id values, with logging of removed entries
  • CLI improvements
    • Fixed the --filter_dict option in the CLI, setting default to None instead of False, changing the type from bool to str and correcting the short flag from -dn to -fd
  • Workflow updates
    • Added the miniconda-version: latest parameter to all GitHub Actions workflows using conda
  • Version bump
    • Incremented version from 0.2.19 to 0.2.20 across all relevant files
  • Added CLI run to quicktests
    • Included a directLFQ CLI run in the quicktests script for more comprehensive testing

Copy link
Contributor

@mschwoer mschwoer left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -310,6 +310,17 @@ def index_and_log_transform_input_df(data_df):
def remove_allnan_rows_input_df(data_df):
return data_df.dropna(axis = 0, how = 'all')

def remove_potential_quant_id_duplicates(data_df):
Copy link
Contributor

Choose a reason for hiding this comment

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

type hints & docstring?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

after_drop = len(data_df)
if before_drop != after_drop:
entries_removed = before_drop - after_drop
LOGGER.info(f"Duplicate quant_ids detected. {entries_removed} rows removed from input df.")
Copy link
Contributor

Choose a reason for hiding this comment

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

warning?

Copy link
Member Author

Choose a reason for hiding this comment

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

👍

Comment on lines +316 to +318
after_drop = len(data_df)
if before_drop != after_drop:
entries_removed = before_drop - after_drop
Copy link
Contributor

Choose a reason for hiding this comment

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

(nit) could be simplified
if (entries_removed:= before_drop - after_drop):

@ammarcsj
Copy link
Member Author

thanks Magnus!

@ammarcsj ammarcsj merged commit 62fce98 into master Aug 13, 2024
9 checks passed
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