Skip to content

Commit

Permalink
Run updated version of black to fix CI (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Feb 6, 2022
1 parent 80c0709 commit c4324c3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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

0 comments on commit c4324c3

Please sign in to comment.