Skip to content

Commit acf0d4f

Browse files
committed
update pre-commit hooks, update to stable black
1 parent f39f381 commit acf0d4f

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.0.1
5+
rev: v4.1.0
66
hooks:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
@@ -13,15 +13,15 @@ repos:
1313
- id: check-case-conflict
1414
- id: check-docstring-first
1515
- repo: https://github.com/pycqa/isort
16-
rev: 5.8.0
16+
rev: "5.10.1"
1717
hooks:
1818
- id: isort
1919
- repo: https://github.com/psf/black
20-
rev: 21.6b0
20+
rev: "22.1.0"
2121
hooks:
2222
- id: black
2323
- repo: https://github.com/pycqa/flake8
24-
rev: 3.9.2
24+
rev: "4.0.1"
2525
hooks:
2626
- id: flake8
2727
additional_dependencies: [flake8-docstrings]

.zenodo.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,4 @@
8080
"resource_type": "software"
8181
}
8282
]
83-
}
83+
}

examples/run_full_prep.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
EEG_raw_matlab = sio.loadmat(fname_mat1)
130130
EEG_raw_matlab = EEG_raw_matlab["save_data"]
131131
EEG_raw_diff = EEG_raw - EEG_raw_matlab
132-
EEG_raw_mse = (EEG_raw_diff / EEG_raw_max ** 2).mean(axis=None)
132+
EEG_raw_mse = (EEG_raw_diff / EEG_raw_max**2).mean(axis=None)
133133

134134
fig, axs = plt.subplots(5, 3, sharex="all", figsize=(16, 12))
135135
plt.setp(fig, facecolor=[1, 1, 1])

pyprep/utils.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def _eeglab_calc_g(pos_from, pos_to, stiffness=4, num_lterms=7):
283283
# Calculate Legendre coefficients for the given degree and stiffness
284284
factors = [0]
285285
for n in range(1, num_lterms + 1):
286-
f = (2 * n + 1) / (n ** stiffness * (n + 1) ** stiffness * 4 * np.pi)
286+
f = (2 * n + 1) / (n**stiffness * (n + 1) ** stiffness * 4 * np.pi)
287287
factors.append(f)
288288

289289
return legval(EI, factors)
@@ -452,8 +452,8 @@ def _correlate_arrays(a, b, matlab_strict=False):
452452
453453
"""
454454
if matlab_strict:
455-
SSa = np.sum(a ** 2, axis=1)
456-
SSb = np.sum(b ** 2, axis=1)
455+
SSa = np.sum(a**2, axis=1)
456+
SSb = np.sum(b**2, axis=1)
457457
SSab = np.sum(a * b, axis=1)
458458
return SSab / (np.sqrt(SSa) * np.sqrt(SSb))
459459
else:

tests/test_removeTrend.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def test_highpass():
2727
error1 = lowpass_filt1 - highfreq_signal
2828
error2 = lowpass_filt2 - highfreq_signal
2929
error3 = lowpass_filt3 - highfreq_signal
30-
assert np.sqrt(np.mean(error1 ** 2)) < 0.1
31-
assert np.sqrt(np.mean(error2 ** 2)) < 0.1
32-
assert np.sqrt(np.mean(error3 ** 2)) < 0.1
30+
assert np.sqrt(np.mean(error1**2)) < 0.1
31+
assert np.sqrt(np.mean(error2**2)) < 0.1
32+
assert np.sqrt(np.mean(error3**2)) < 0.1
3333

3434

3535
def test_detrend():
@@ -45,4 +45,4 @@ def test_detrend():
4545
signal_trend, detrendType="Local detrend", sample_rate=100
4646
)
4747
error3 = signal_detrend - signal
48-
assert np.sqrt(np.mean(error3 ** 2)) < 0.1
48+
assert np.sqrt(np.mean(error3**2)) < 0.1

0 commit comments

Comments
 (0)