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 informative merge suffixes for platemap and external metadata column collisions #292

Merged
merged 10 commits into from
Jul 5, 2023

Conversation

kenibrewer
Copy link
Member

@kenibrewer kenibrewer commented Jun 11, 2023

Description

This is a breaking change that addresses #249 . It is a breaking change in that output files processed with this version of pycytominer.annotate may differ from those processed by the previous version (but only where metadata column collisions are already happening).

Previously, if a platemap or external metadata table had columns that were already present in the profiles_df un-informative _x, _y suffixes were used that made results more unpredictable and hard to code for. This change will instead leave the profiles_df column names unchanged in annotated_df, and add new columns with either _platemap or _external suffixes.

I also included some changes to annotate.py that previously used the string "none" as an argument instead of None. The latter is more pythonic and the way most users expect to interact with those arguments.

EDIT: "None" arg changes moved to #293

What is the nature of your change?

  • Enhancement (adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

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.
  • 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 Jun 12, 2023

Codecov Report

Merging #292 (b933f0b) into master (7c4f166) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #292      +/-   ##
==========================================
+ Coverage   95.12%   95.17%   +0.05%     
==========================================
  Files          57       57              
  Lines        3057     3068      +11     
==========================================
+ Hits         2908     2920      +12     
+ Misses        149      148       -1     
Flag Coverage Δ
unittests 95.17% <100.00%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
pycytominer/annotate.py 100.00% <ø> (+3.57%) ⬆️
pycytominer/tests/test_annotate.py 100.00% <100.00%> (ø)

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

@kenibrewer
Copy link
Member Author

@d33bs @gwaybio This PR is ready for review.

Copy link
Member

@gwaybio gwaybio left a comment

Choose a reason for hiding this comment

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

Discussion item regarding understanding the problem and determining where to place solution.

I also see that there is no external metadata test - would you be able to add a test here?

pycytominer/annotate.py Show resolved Hide resolved
pycytominer/annotate.py Show resolved Hide resolved
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! I left a few comments for your consideration. Mostly I felt things looked good, but am interested in your thoughts with regards to the approach. As @gwaybio mentioned, I'd also wonder about a test for the external metadata to make sure this works in alignment with the platemap data.

pycytominer/annotate.py Show resolved Hide resolved
pycytominer/annotate.py Show resolved Hide resolved
pycytominer/tests/test_annotate.py Outdated Show resolved Hide resolved
@kenibrewer kenibrewer requested review from d33bs and gwaybio July 4, 2023 14:32
Copy link
Member

@gwaybio gwaybio left a comment

Choose a reason for hiding this comment

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

Looks great @kenibrewer ! I'll get this merged in

pycytominer/tests/test_annotate.py Outdated Show resolved Hide resolved
pycytominer/tests/test_annotate.py Show resolved Hide resolved
pycytominer/annotate.py Show resolved Hide resolved
pycytominer/annotate.py Show resolved Hide resolved
pycytominer/annotate.py Show resolved Hide resolved
pycytominer/annotate.py Show resolved Hide resolved
@gwaybio gwaybio merged commit 8bb408e into cytomining:master Jul 5, 2023
@kenibrewer kenibrewer deleted the feature/annotate_merge_suffix branch July 5, 2023 23:09
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.

4 participants