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

Commit09ed35e

Browse files
authored
Merge pull request#579 from DimitriPapadopoulos/SIM
Apply ruff/flake8-simplify rules (SIM)
2 parentsccd12f7 +21c58c8 commit09ed35e

File tree

4 files changed

+5
-12
lines changed

4 files changed

+5
-12
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)

‎nipy/io/nifti_ref.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def nifti2nipy(ni_img):
580580
ifndim==3:
581581
returnImage(data,cmap3, {'header':hdr})
582582
space_units,time_like_units=hdr.get_xyzt_units()
583-
units_info=TIME_LIKE_UNITS.get(time_like_units,None)
583+
units_info=TIME_LIKE_UNITS.get(time_like_units)
584584
n_ns=ndim-3
585585
ns_zooms=list(hdr.get_zooms()[3:])
586586
ns_trans= [0]*n_ns

‎nipy/io/tests/test_nibcompat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_unscaled_data(in_tmp_path):
4242
header=get_header(img_back)
4343
dao=get_dataobj(img_back)
4444
slope=header['scl_slope']
45-
inter= (0.if'scl_inter'notinheaderelseheader['scl_inter'])
45+
inter= (header.get('scl_inter',0.0))
4646
ifnp.isnan(slope):
4747
slope,inter=dao.slope,dao.inter
4848
data_back=np.array(dao)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp