Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/nipyPublic

Commitb84d9bc

Browse files
Apply ruff/flake8-simplify rule SIM103
SIM103 Return the (negated) condition directly
1 parent2c1cf76 commitb84d9bc

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

‎nipy/algorithms/registration/optimizer.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,4 @@ def configure_optimizer(optimizer, fprime=None, fhess=None, **kwargs):
4646

4747

4848
defuse_derivatives(optimizer):
49-
ifoptimizerin ('simplex','powell'):
50-
returnFalse
51-
else:
52-
returnTrue
49+
returnoptimizernotin ('simplex','powell')

‎nipy/algorithms/statistics/models/regression.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,7 @@ def has_intercept(self):
264264
o=np.ones(self.design.shape[0])
265265
obeta=np.dot(self.calc_beta,o)
266266
ohat=np.dot(self.wdesign,obeta)
267-
ifnp.allclose(ohat,o):
268-
returnTrue
269-
returnFalse
267+
returnnp.allclose(ohat,o)
270268

271269
@cached_property
272270
defrank(self):
@@ -872,6 +870,4 @@ def isestimable(C, D):
872870
ifC.shape[1]!=D.shape[1]:
873871
raiseValueError('Contrast should have %d columns'%D.shape[1])
874872
new=np.vstack([C,D])
875-
ifmatrix_rank(new)!=matrix_rank(D):
876-
returnFalse
877-
returnTrue
873+
returnmatrix_rank(new)==matrix_rank(D)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp