-
Notifications
You must be signed in to change notification settings - Fork 20
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
Perturbation space - pseudobulk, discriminative classifier, clustering #316
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…efactoring Signed-off-by: zethson <lukas.heumos@posteo.net>
Zethson
requested changes
Jul 12, 2023
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.
Thank you very much!
Things I did:
- Solved all pre-commit errors. You seem to like mutable defaults (e.g. populated lists) for argument defaults. Don't do this, please :)
- Moved all Made the PerturbationSpace class abstract and all other classes are now implementing it and will be called standalone as discussed
- Moved the _utils stuff into the discriminator file because this is where it's supposed to live
- Random minor stuff
General comments:
- Don't run any functions explicitly in test files. pytest picks them up and runs them on its own.
- The tests are currently bad for two reasons: 1. Some of them are broken and don't even run; 2. They should actually test the calculated perturbation space. Currently you're just running the function and then hoping for the best. Create artificial data that allows you to test for whether the calculated perturbation space makes sense. e.g. 3 very distinct clusters of cells and then measure the R2 between the 3 points of the perturbation space that you calculated and it should be at least SOMENUMBER or so.
- Ensure that every function signature that people will use (call) primarily is similar. All of them should have a
copy
parameter, alayer
parameter, .... you get the gist. The experience when working with the spaces should be very consistent. - Document the functions properly with docstrings. We'll be exposing some functions that are not yet documented (all call primarily)
- Do NOT add type hints in docstrings (as shitty VScode does automatically). We have them in the function signature and Sphinx will renders this eventually.
Please resolve my comments as you go through them. In an ideal world (that we 100% do not have due to lack of time) one would add one commit per comment.
If stuff is unclear - ask away!
tests/tools/_perturbation_space/test_discriminator_classifier.py
Outdated
Show resolved
Hide resolved
Signed-off-by: zethson <lukas.heumos@posteo.net>
… feature/perturbation_space
Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: zethson <lukas.heumos@posteo.net>
Signed-off-by: zethson <lukas.heumos@posteo.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Description of changes
Update of the PerturbationalSpace, including: