neuropsychology / NeuroKit

NeuroKit2: The Python Toolbox for Neurophysiological Signal Processing
https://neuropsychology.github.io/NeuroKit
MIT License
1.53k stars 410 forks source link

[Feature] Test for stats/correlation.py #989

Closed ujdcodr closed 4 months ago

ujdcodr commented 4 months ago

Description

This PR aims at adding a test for the cor() function inside stats/correlation.py in order to improve code coverage.

Proposed Changes

The function test_cor() was added. It contains examples of arrays whose correlation is known.

Pearson Spearman Kendall (page 3)

For each of the 3 methods, array pairs are passed as arguments into the cor function and the computed result is compared with the known result. A separate negative test checks whether incorrect inputs to the 'method' argument are caught.

Checklist

Here are some things to check before creating the PR. If you encounter any issues, do let us know :)

welcome[bot] commented 4 months ago

Thanks for opening this pull request! We'll make sure it's perfect before merging 🤗 force Make sure to read the contributing guide. Also, if you think that your contribution is worthy of it, you can consider adding yourself to the Contributors list (feel free to ask us if you have any doubts).

ujdcodr commented 4 months ago

Looks like an issue with neurokit2/signal is causing the failure. Unrelated to my PR.

DominiqueMakowski commented 4 months ago

Looks good, thanks!

welcome[bot] commented 4 months ago

landing Congrats on merging your first pull request! 🎉🍾 We're looking forward to your next one!