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

Fix to work with flake8 6.0.0 #335

Merged
merged 1 commit into from
Feb 2, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ max-line-length = 120
max-complexity = 45
ignore =
E203
W503 # line break before binary operator; conflicts with black
E722 # bare except ok
E731 # lambda expressions ok
# line break before binary operator; conflicts with black
W503
# bare except ok
E722
# lambda expressions ok
E731
exclude =
.git
.tox
Expand Down
16 changes: 8 additions & 8 deletions tests/test_gp_coefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ def test_conditional_gp(self):

# build index for the global coefficient vector
idx, ntot = {}, 0
for l, v in cmean.items():
idx[l] = slice(ntot, ntot + len(v))
for c_name, v in cmean.items():
idx[c_name] = slice(ntot, ntot + len(v))
ntot = ntot + len(v)

# repeat the computation using the common-signal formalism
Expand All @@ -318,8 +318,8 @@ def test_conditional_gp(self):

# check mean values
msg = "Conditional GP coefficient value does not match"
for l, v in cmean.items():
assert np.allclose(mn[idx[l]], v, atol=1e-4, rtol=1e-4), msg
for c_name, v in cmean.items():
assert np.allclose(mn[idx[c_name]], v, atol=1e-4, rtol=1e-4), msg

# check variances
par = "B1937+21_linear_timing_model_coefficients"
Expand Down Expand Up @@ -360,8 +360,8 @@ def test_conditional_gp(self):
cmean = c.get_mean_coefficients(p0)

idx, ntot = {}, 0
for l, v in cmean.items():
idx[l] = slice(ntot, ntot + len(v))
for c_name, v in cmean.items():
idx[c_name] = slice(ntot, ntot + len(v))
ntot = ntot + len(v)

TNrs = pta.get_TNr(p0)
Expand All @@ -375,8 +375,8 @@ def test_conditional_gp(self):
mn = ch(TNr)

msg = "Conditional GP coefficient value does not match for common GP"
for l, v in cmean.items():
assert np.allclose(mn[idx[l]], v)
for c_name, v in cmean.items():
assert np.allclose(mn[idx[c_name]], v)


class TestGPCoefficientsPint(TestGPCoefficients):
Expand Down