Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelvallat committed Nov 11, 2023
1 parent dd813a2 commit f7c8905
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pingouin/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,16 +457,16 @@ def anderson(*args, dist="norm"):
(True, 15.0)
"""
k = len(args)
from_dist = np.zeros(k, "bool")
from_dist = np.zeros(k, dtype="bool")
sig_level = np.zeros(k)
for j in range(k):
st, cr, sig = scipy.stats.anderson(args[j], dist=dist)
from_dist[j] = True if (st < cr).any() else False
sig_level[j] = sig[np.argmin(np.abs(st - cr))]

if k == 1:
from_dist = bool(from_dist)
sig_level = float(sig_level)
from_dist = from_dist[0]
sig_level = sig_level[0]
return from_dist, sig_level


Expand Down
2 changes: 1 addition & 1 deletion pingouin/tests/test_correlation.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_corr(self):
# Compare BF10 with JASP
df = read_dataset("pairwise_corr")
stats = corr(df["Neuroticism"], df["Extraversion"])
assert np.isclose(1 / float(stats["BF10"].to_numpy()), 1.478e-13)
assert np.isclose(1 / float(stats.at["pearson", "BF10"]), 1.478e-13)
# Perfect correlation, CI and power should be 1, BF should be Inf
# https://github.com/raphaelvallat/pingouin/issues/195
stats = corr(x, x)
Expand Down
4 changes: 2 additions & 2 deletions pingouin/tests/test_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,5 @@ def test_sphericity(self):

def test_anderson(self):
"""Test function test_anderson."""
assert anderson(np.random.random(size=1000))[0] is False
assert anderson(np.random.normal(size=10000))[0] is True
assert not anderson(np.random.random(size=1000))[0]
assert anderson(np.random.normal(size=10000))[0]
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ statistics=True
[coverage:run]
branch = True
source = pingouin
include = */pingouin/*
omit =
*/setup.py
*/examples/*
Expand Down

0 comments on commit f7c8905

Please sign in to comment.