-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Ciela-Institute/morewarnings
More warnings and information on how PQM works. Added more unit tests
- Loading branch information
Showing
4 changed files
with
181 additions
and
104 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pytest | ||
from pqm import pqm_pvalue, pqm_chi2 | ||
import numpy as np | ||
|
||
|
||
def test_num_refs(): | ||
with pytest.raises(ValueError): | ||
pqm_pvalue(np.random.normal(size=(10, 50)), np.random.normal(size=(15, 50)), num_refs=100) | ||
with pytest.raises(ValueError): | ||
pqm_chi2(np.random.normal(size=(15, 50)), np.random.normal(size=(10, 50)), num_refs=100) | ||
|
||
with pytest.warns(UserWarning): | ||
pqm_pvalue( | ||
np.random.normal(size=(100, 100)), np.random.normal(size=(110, 100)), num_refs=150 | ||
) | ||
|
||
|
||
def test_filled_bins(): | ||
with pytest.raises(ValueError): | ||
pqm_pvalue(np.zeros(shape=(500, 50)), np.zeros(shape=(250, 50)), num_refs=10) |
Oops, something went wrong.