Skip to content

FIX: LGTM alerts #1043

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

Merged
merged 4 commits into from
Sep 8, 2021
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
3 changes: 1 addition & 2 deletions nibabel/cifti2/cifti2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,8 +1156,7 @@ def get_index_map(self, index):
a2md = self._get_indices_from_mim(v)
if index in a2md:
return v
else:
raise Cifti2HeaderError("Index not mapped")
raise Cifti2HeaderError("Index not mapped")

def _validate_new_mim(self, value):
if value.applies_to_matrix_dimension is None:
Expand Down
2 changes: 1 addition & 1 deletion nibabel/cmdline/dicomfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_paths(self):
for study in dft.get_studies(self.dicom_path, self.followlinks):
pd = paths.setdefault(study.patient_name_or_uid(), {})
patient_info = 'patient information\n'
patient_info = f'name: {study.patient_name}\n'
patient_info += f'name: {study.patient_name}\n'
patient_info += f'ID: {study.patient_id}\n'
patient_info += f'birth date: {study.patient_birth_date}\n'
patient_info += f'sex: {study.patient_sex}\n'
Expand Down
2 changes: 1 addition & 1 deletion nibabel/filebasedimages.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def __init__(self, header=None, extra=None, file_map=None):
def header(self):
return self._header

def __getitem__(self):
def __getitem__(self, key):
""" No slicing or dictionary interface for images
"""
raise TypeError("Cannot slice image objects.")
Expand Down
1 change: 0 additions & 1 deletion nibabel/pydicom_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
# Module has (apparently) unused imports; stop flake8 complaining
# flake8: noqa

import numpy as np
from .deprecated import deprecate_with_version

have_dicom = True
Expand Down
3 changes: 0 additions & 3 deletions nisext/py3builder.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
""" distutils utilities for porting to python 3 within 2-compatible tree """


import sys
import re

try:
from distutils.command.build_py import build_py_2to3
except ImportError:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"""Build helper."""

import sys
import os

from setuptools import setup
import versioneer
Expand Down
2 changes: 0 additions & 2 deletions tools/make_tarball.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import commands
import os
import sys
import shutil

from toollib import *

Expand Down
2 changes: 0 additions & 2 deletions tools/mpkg_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
__docformat__ = 'restructuredtext'

import sys
import setuptools
import bdist_mpkg

def main():
del sys.argv[0]
Expand Down