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

Add CLI for coSMicQC #34

Merged
merged 44 commits into from
Jun 26, 2024
Merged

Add CLI for coSMicQC #34

merged 44 commits into from
Jun 26, 2024

Conversation

d33bs
Copy link
Member

@d33bs d33bs commented Jun 12, 2024

Description

This PR adds a CLI for coSMicQC through the use of fire. This work depends on changes from #32 . Along the journey towards these changes I discovered there were challenges in displaying pd.DataFrame's (or related SCDataFrame's) through fire CLI's. As a result, I added a patch inspired from work in google/python-fire#446 by reassigning the _PrintResult function to match the contents of the fix. Once the fix is merged in fire we should remove the patch and rely on fire for these changes. When/if these changes are merged, I'll create an issue to track this so we don't forget to take action here.

Along with these changes some docs were fixed.

This should be reviewed and merged after #32

Closes #14
Closes #37

What kind of change(s) are included?

  • Feature (adds or updates new capabilities)
  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (these changes would cause existing functionality to not work as expected).

Checklist

Please ensure that all boxes are checked before indicating that this pull request is ready for review.

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have searched for existing content to ensure this is not a duplicate.
  • I have performed a self-review of these additions (including spelling, grammar, and related).
  • These changes pass all pre-commit checks.
  • I have added comments to my code to help provide understanding
  • I have added a test which covers the code changes found within this PR
  • I have deleted all non-relevant text in this pull request template.

@d33bs
Copy link
Member Author

d33bs commented Jun 12, 2024

In chatting with @jenna-tomkinson, we discussed that getting a file-based output would potentially be more useful than text-based output. The filename could use the input filename as the basis for output filename, for example example.csv would become example.identify_outliers.parquet

@d33bs
Copy link
Member Author

d33bs commented Jun 13, 2024

Thinking on file-based output a little more made me feel that that work might be best served after merging #32 and this PR. Generally, I'm worried that there may be complex scenarios where one would want a file vs not. It also might be possible to control the export of files through a similar mechanism to pd.DataFrame, i.e. pd.DataFrame.to_parquet(...), etc. which could avoid us having to maintain additional code. Created #37 as a result.

Decided to implement this within the same PR.

@d33bs d33bs requested a review from jenna-tomkinson June 25, 2024 19:43
@d33bs d33bs marked this pull request as ready for review June 25, 2024 19:43
Copy link
Member

@jenna-tomkinson jenna-tomkinson left a comment

Choose a reason for hiding this comment

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

I am approving this PR since I do not see any issues in the code that looks to cause any bugs. I left a lot of comments with questions and suggestions for increasing clarity for a reader of the code. Nice job! 🎉

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
src/cosmicqc/analyze.py Show resolved Hide resolved
src/cosmicqc/analyze.py Show resolved Hide resolved
src/cosmicqc/cli.py Show resolved Hide resolved
src/cosmicqc/cli.py Outdated Show resolved Hide resolved
src/cosmicqc/scdataframe.py Outdated Show resolved Hide resolved
tests/__init__.py Outdated Show resolved Hide resolved
tests/test_cli.py Outdated Show resolved Hide resolved
tests/test_cli.py Show resolved Hide resolved
@d33bs
Copy link
Member Author

d33bs commented Jun 26, 2024

Thanks @jenna-tomkinson for the review! I've addressed your comments and will now merge this in.

@d33bs d33bs merged commit 037fbce into WayScience:main Jun 26, 2024
11 checks passed
@d33bs d33bs deleted the add-cli branch June 26, 2024 21:49
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.

Add options for file-based output Add CLI options for package use
2 participants