Skip to content

Commit

Permalink
Fix to work with flake8 6.0.0 (#335)
Browse files Browse the repository at this point in the history
Co-authored-by: Anne Archibald <[email protected]>
  • Loading branch information
aarchiba and Anne Archibald authored Feb 2, 2023
1 parent 1ca6d38 commit 36c979d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
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

0 comments on commit 36c979d

Please sign in to comment.