Skip to content

Commit d6946b6

Browse files
Apply ruff/flake8-simplify rule SIM401
SIM401 Use `get()` instead of an `if` block
1 parent b84d9bc commit d6946b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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' not in header else header['scl_inter'])
45+
inter = (header.get('scl_inter', 0.0))
4646
if np.isnan(slope):
4747
slope, inter = dao.slope, dao.inter
4848
data_back = np.array(dao)

0 commit comments

Comments
 (0)