-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bugfix/shape space test #52
Conversation
assert df[column].dtype == np.float64 | ||
numzero = sum(df[column] == 0.0) | ||
# Since we used gaussian data the result should almost always have no zeros | ||
assert numzero < 3 |
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.
If there should almost always be no zeros why are we asserting that there is less than 3? If its an almost should we even test?
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.
It's similar to the probability of picking a random float and seeing if it happens to be an integer, a very tiny probability. The probability that 3 of the values are exactly zero is exceptionally tiny. Error cases would look like having a whole column that's all zero.
I suspect there is a clearer way to write this but I don't have a great idea. It could just be assert numzero == 0
.
return df | ||
|
||
|
||
def assert_NUC_PC_columns_nonzero(df): |
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.
All other test methods have, Arrange, Act, and Assert.
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.
Not a test, just a helper function
Apparently the test did not pass! Since I copied the wrong I'll also try to set up github actions to block merging if the tests don't pass |
CI failure is due to broken CI config: future work |
These were left out of PR #52
Summary
Adding tests for shape mode calculations used by NucMorph. In the process I found a bug cause by the typo
get_Lmax
(should beget_lmax
).Changes
tests/data
folder to compare across refactors.Testing
I ran
pytest
and all three tests pass. From the commit before the bugfix, one test fails because of theget_Lmax
bug.Pull request recommendations: