Skip to content

Commit

Permalink
update pre-commit hooks, update to stable black
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff committed Feb 2, 2022
1 parent f39f381 commit acf0d4f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -13,15 +13,15 @@ repos:
- id: check-case-conflict
- id: check-docstring-first
- repo: https://github.com/pycqa/isort
rev: 5.8.0
rev: "5.10.1"
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 21.6b0
rev: "22.1.0"
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
rev: "4.0.1"
hooks:
- id: flake8
additional_dependencies: [flake8-docstrings]
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@
"resource_type": "software"
}
]
}
}
2 changes: 1 addition & 1 deletion examples/run_full_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
EEG_raw_matlab = sio.loadmat(fname_mat1)
EEG_raw_matlab = EEG_raw_matlab["save_data"]
EEG_raw_diff = EEG_raw - EEG_raw_matlab
EEG_raw_mse = (EEG_raw_diff / EEG_raw_max ** 2).mean(axis=None)
EEG_raw_mse = (EEG_raw_diff / EEG_raw_max**2).mean(axis=None)

fig, axs = plt.subplots(5, 3, sharex="all", figsize=(16, 12))
plt.setp(fig, facecolor=[1, 1, 1])
Expand Down
6 changes: 3 additions & 3 deletions pyprep/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def _eeglab_calc_g(pos_from, pos_to, stiffness=4, num_lterms=7):
# Calculate Legendre coefficients for the given degree and stiffness
factors = [0]
for n in range(1, num_lterms + 1):
f = (2 * n + 1) / (n ** stiffness * (n + 1) ** stiffness * 4 * np.pi)
f = (2 * n + 1) / (n**stiffness * (n + 1) ** stiffness * 4 * np.pi)
factors.append(f)

return legval(EI, factors)
Expand Down Expand Up @@ -452,8 +452,8 @@ def _correlate_arrays(a, b, matlab_strict=False):
"""
if matlab_strict:
SSa = np.sum(a ** 2, axis=1)
SSb = np.sum(b ** 2, axis=1)
SSa = np.sum(a**2, axis=1)
SSb = np.sum(b**2, axis=1)
SSab = np.sum(a * b, axis=1)
return SSab / (np.sqrt(SSa) * np.sqrt(SSb))
else:
Expand Down
8 changes: 4 additions & 4 deletions tests/test_removeTrend.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def test_highpass():
error1 = lowpass_filt1 - highfreq_signal
error2 = lowpass_filt2 - highfreq_signal
error3 = lowpass_filt3 - highfreq_signal
assert np.sqrt(np.mean(error1 ** 2)) < 0.1
assert np.sqrt(np.mean(error2 ** 2)) < 0.1
assert np.sqrt(np.mean(error3 ** 2)) < 0.1
assert np.sqrt(np.mean(error1**2)) < 0.1
assert np.sqrt(np.mean(error2**2)) < 0.1
assert np.sqrt(np.mean(error3**2)) < 0.1


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

0 comments on commit acf0d4f

Please sign in to comment.