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

Make sample argument uniform for normalize and feature_select #311

Merged
merged 9 commits into from
Jul 21, 2023

Conversation

gwaybio
Copy link
Member

@gwaybio gwaybio commented Jul 17, 2023

Description

Currently, the samples argument in the normalize function expects a string to be used in a pandas.DataFrame().query() call. However ,the samples argument in feature_select() (and all associated operations) expects the samples argument to be a list to be used in a pandas.DataFrame().loc[] call.

Here, I update all feature_select() operations to expect the pandas.DataFrame.query() call. I also update the documentation and tests.

What is the nature of your change?

  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • This change requires a documentation update.

Checklist

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

  • I have read the CONTRIBUTING.md guidelines.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have deleted all non-relevant text in this pull request template.

@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2023

Codecov Report

Merging #311 (d9b06fe) into master (8e3c28d) will increase coverage by 0.08%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #311      +/-   ##
==========================================
+ Coverage   95.25%   95.34%   +0.08%     
==========================================
  Files          57       57              
  Lines        3120     3134      +14     
==========================================
+ Hits         2972     2988      +16     
+ Misses        148      146       -2     
Flag Coverage Δ
unittests 95.34% <100.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pycytominer/cyto_utils/features.py 89.79% <100.00%> (ø)
pycytominer/operations/correlation_threshold.py 100.00% <100.00%> (ø)
pycytominer/operations/get_na_columns.py 100.00% <100.00%> (ø)
pycytominer/operations/noise_removal.py 95.00% <100.00%> (+5.00%) ⬆️
pycytominer/operations/variance_threshold.py 100.00% <100.00%> (+2.94%) ⬆️
...tests/test_cyto_utils/test_feature_drop_outlier.py 100.00% <100.00%> (ø)
pycytominer/tests/test_feature_select.py 100.00% <100.00%> (ø)
...ests/test_operations/test_correlation_threshold.py 100.00% <100.00%> (ø)
...miner/tests/test_operations/test_get_na_columns.py 100.00% <100.00%> (ø)
...r/tests/test_operations/test_variance_threshold.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@gwaybio gwaybio requested a review from d33bs July 18, 2023 20:41
Copy link
Member

@d33bs d33bs 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! Kudos also on the increased test coverage percentage. I thought things looked good with this PR and only had suggestions for enhancements. Generally I left comments in pycytominer/cyto_utils/features.py which apply to multiple files with the pd.DataFrame.query() repeated blocks. Please don't hesitate to let me know if you have any questions.

pycytominer/cyto_utils/features.py Outdated Show resolved Hide resolved
pycytominer/cyto_utils/features.py Outdated Show resolved Hide resolved
pycytominer/operations/correlation_threshold.py Outdated Show resolved Hide resolved
pycytominer/operations/get_na_columns.py Outdated Show resolved Hide resolved
pycytominer/operations/noise_removal.py Outdated Show resolved Hide resolved
pycytominer/operations/variance_threshold.py Outdated Show resolved Hide resolved
pycytominer/cyto_utils/features.py Show resolved Hide resolved
pycytominer/cyto_utils/features.py Show resolved Hide resolved
pycytominer/cyto_utils/features.py Outdated Show resolved Hide resolved
gwaybio and others added 2 commits July 21, 2023 13:31
Co-authored-by: Dave Bunten <ekgto445@gmail.com>
@gwaybio gwaybio merged commit c4de0a9 into cytomining:master Jul 21, 2023
10 checks passed
@gwaybio gwaybio deleted the uniform-sample-args branch July 21, 2023 19:58
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.

3 participants