Skip to content
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

Run updated version of black to fix CI #79

Merged
merged 1 commit into from
Feb 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pymare/estimators/combination.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def p_value(self, z, w=None):
"""Calculate p-values."""
if w is None:
w = np.ones_like(z)
cz = (z * w).sum(0) / np.sqrt((w ** 2).sum(0))
cz = (z * w).sum(0) / np.sqrt((w**2).sum(0))
return ss.norm.sf(cz)


Expand Down
2 changes: 1 addition & 1 deletion pymare/estimators/estimators.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def fit(self, y, v, X):

# Einsum indices: k = studies, p = predictors, i = parallel iterates.
# q is a dummy for 2nd p when p x p covariance matrix is passed.
Xw2 = np.einsum("kp,ki->ipk", X, w ** 2)
Xw2 = np.einsum("kp,ki->ipk", X, w**2)
pXw2 = np.einsum("ipk,qpi->iqk", Xw2, inv_cov)
A = w_sum - np.trace(pXw2.dot(X), axis1=1, axis2=2)
tau_dl = (Q - (k - p)) / A
Expand Down
4 changes: 2 additions & 2 deletions pymare/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def permutation_test(self, n_perm=1000):
if has_mods:
n_exact = np.math.factorial(n_obs)
else:
n_exact = 2 ** n_obs
n_exact = 2**n_obs
if n_exact < n_perm:
perms = np.array(list(itertools.product([-1, 1], repeat=n_obs))).T

Expand Down Expand Up @@ -308,7 +308,7 @@ def permutation_test(self, n_perm=1000):
p_p = np.zeros_like(self.z)

# Calculate # of permutations and determine whether to use exact test
n_exact = 2 ** n_obs
n_exact = 2**n_obs
if n_exact < n_perm:
perms = np.array(list(itertools.product([-1, 1], repeat=n_obs))).T
exact = True
Expand Down
2 changes: 1 addition & 1 deletion pymare/tests/test_effectsize_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_convert_r_to_itself():
esc.get_v_r()
esc = OneSampleEffectSizeConverter(r=r, n=n)
v_r = esc.get("V_R")
assert np.allclose(v_r, (1 - r ** 2) / (n - 2))
assert np.allclose(v_r, (1 - r**2) / (n - 2))
ds = esc.to_dataset(measure="R")
assert np.allclose(ds.y.ravel(), r)
assert np.allclose(ds.v.ravel(), v_r)
Expand Down