-
Notifications
You must be signed in to change notification settings - Fork 168
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 test outlier detection #298
Conversation
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.
thanks a lot for your contribution, i proposed a few modifications to your code
@@ -174,3 +174,9 @@ def test_detect_outlier_multivariate_local(): | |||
V[-1] = (-3, 3) | |||
outliers = cleansing.detect_outliers(V, 4, coord=X, k=50) | |||
assert outliers.sum() == 2 | |||
|
|||
def test_detect_outlier_input_dims(): | |||
V = np.zeros((20, 3, 2)) |
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.
could you test a list of input dimensions/different cases?
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.
Thanks @chiara-arpae for the contribution.
The test is failing because there is a bug in the detect_outliers
function.
When the dimensions are incorrect, the code raising the exception has a error:
raise ValueError(
f"input_array must have 1 (n) or 2 dimensions (n, m), "
f"but it has {coord.ndim}"
)
Here, {coord.ndim}
should be {input_array.ndim}
Do you want to add the fix to bug?
hey @chiara-arpae please let us know if something is not clear in the comments left above. The pull request is almost ready to be merged, just few final changes are needed ;) |
Hi! I'm very sorry for late. I should have committed the suggested correction few minutes ago. Please let me know if it's all fine. |
correcting input_array instead of coords in log message
Hi, I'm very sorry for late. I should have committed the correction but I
received a message about check black failing from Github.
I realized I have modified and committed on master branch, instead of doing
it on the branch 'test_cleaning_2d'. Maybe could it depend on that? Sorry
very much for mess. If you could help me I'd be grateful.
Il giorno ven 16 set 2022 alle ore 10:32 Daniele Nerini <
***@***.***> ha scritto:
… hey @chiara-arpae <https://github.com/chiara-arpae> please let us know if
something is not clear in the comments left above. The pull request is
almost ready to be merged, just few final changes are needed ;)
—
Reply to this email directly, view it on GitHub
<#298 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQ2PKGSGINQDM24BD7VMYZDV6QWCFANCNFSM573BL2AA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Codecov Report
@@ Coverage Diff @@
## master #298 +/- ##
==========================================
+ Coverage 82.71% 82.74% +0.03%
==========================================
Files 160 160
Lines 12292 12310 +18
==========================================
+ Hits 10167 10186 +19
+ Misses 2125 2124 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
removed k parameter from cleansing.detect_outliers in test.test_utils_cleansing.test_detect_outlier_input_dims() because not necessary for test and coords is not passed.
hey @chiara-arpae no worries and thanks for getting back on this! It looks good to go! :-) |
[ERAD]Test that input arrays with more than 2 dimensions raise a ValueError exception](https://app.codecov.io/gh/pySTEPS/pysteps/compare/283/tree/pysteps/utils/cleansing.py#D1L173)