-
Notifications
You must be signed in to change notification settings - Fork 36
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
Update error message and docs for features
argument to clarify CellProfiler default expectations and how to handle non-CellProfiler data
#448
Conversation
@axiomcura - integration tests failed, please fix. Looks like the tests expect a specific error message which also needs updating |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #448 +/- ##
=======================================
Coverage 94.72% 94.72%
=======================================
Files 57 57
Lines 3145 3146 +1
=======================================
+ Hits 2979 2980 +1
Misses 166 166
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@gwaybio All tests have passed! Please review when you have a moment to confirm if it's safe to merge. |
Thanks Erik! I see that the tests are passing now. Re-reading the reviewer comment, it seemed that they have issues with the metadata parameter. I'm thinking that in addition to clarifying the Perhaps we can do two more things in this PR to update error message in the metadata inference.
I'll also tag @d33bs - Dave, after Erik addresses these two points, perhaps you can take a final look to see if both Erik and I overlooked something in making this change. Thanks! |
@gwaybio - This is certainly doable, but I have a few clarifying questions. Could you please explain why the exception condition needs to be From my understanding, Pycytominer’s main functions default to I might be misunderstanding something where the |
Great catch Erik! We should not check metadata features in the way I suggested above. We ask users to provide metadata features within each function (e.g., Perhaps the only change should be whereever we see We add some specification to clarify that the cases in which I think this is a relatively minor and straightforward fix.
|
@gwaybio - I have updated the docstrings. |
…tures parameter since it does not exist in the function
features
argument to clarify CellProfiler default expectations and how to handle non-CellProfiler data
Ahh shucks... there's going to be a lot of merge conflicts between this branch and #396. I was going to finish that one off this weekend. Not sure which order we want to merge / resolve merge conflicts in. |
Bummer! My sense is:
We'll likely do 1 and 2 before the weekend FWIW |
Sounds good! Let's do that! |
@d33bs - ready for you to take a final look, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
This would have been very helpful for my first attempt at using pycytominer too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job, I left a few minor comments, otherwise LGTM!
Co-authored-by: Dave Bunten <[email protected]>
Co-authored-by: Dave Bunten <[email protected]>
Co-authored-by: Dave Bunten <[email protected]>
Co-authored-by: Dave Bunten <[email protected]>
Co-authored-by: Dave Bunten <[email protected]>
merged! |
Description
Thank you for your contribution to pycytominer!
Please succinctly summarize your proposed change.
What motivated you to make this change?
Summary
This PR addresses one of the reviewers’ comments:
" When I used the function pycytominer.normalize() on a dataset originating from my own work, I encountered an error message saying
“No CP features found. Are you sure this dataframe is from CellProfiler?”.
I could easily fix the problem because I know the properties of a CellProfiler dataset, and the error message was hinting at some “Metadata_” missing.
The fix was very easy, I just needed to add the prefix “Metadata_” to my metadata columns. My dataset comes from another commonly used proprietary software called Harmony. I understand that the authors are in favor of using open-source resources, but I think that the pycytominer tool could be useful in a much larger context, and take as input different types of datasets. In the readme file, that I followed to perform the normalization, I couldn’t find anywhere that the dataset has to come from CellProfiler. ..."
I replaced the ‘assert’ statement with an exception, as it’s considered bad practice to use assertions during runtime. Assertions can be disabled with the
-o
parameter, which means they aren’t reliable for handling errors in production code.Here are some useful links:
Additionally, I updated the error message to clarify that pycytominer infers CellProfiler features by default and provided guidance on how users can manually specify their feature space when working with non-CellProfiler data.
Please also link to any relevant issues that your code is associated with.
This code is also an addition to #430
What is the nature of your change?
Checklist
Please ensure that all boxes are checked before indicating that a pull request is ready for review.