diff --git a/nixio/block.py b/nixio/block.py index 622f7b04..081f89ee 100644 --- a/nixio/block.py +++ b/nixio/block.py @@ -337,7 +337,7 @@ def create_data_frame(self, name="", type_="", col_dict=None, else: # if col_names is None if data is not None and type(data[0]) == np.void: col_dtype = data[0].dtype - for i, dt in enumerate(col_dtype.fields.values()): + for dt in col_dtype.fields.values(): cn = list(col_dtype.fields.keys()) raw_dt = col_dtype.fields.values() raw_dt = list(raw_dt) diff --git a/nixio/data_array.py b/nixio/data_array.py index 5aa56398..5b54752a 100644 --- a/nixio/data_array.py +++ b/nixio/data_array.py @@ -20,7 +20,7 @@ from . import util from .compression import Compression -from .exceptions import InvalidUnit, IncompatibleDimensions +from .exceptions import IncompatibleDimensions from .section import Section diff --git a/nixio/data_frame.py b/nixio/data_frame.py index a4ce238e..9bb9cb74 100644 --- a/nixio/data_frame.py +++ b/nixio/data_frame.py @@ -185,7 +185,7 @@ def write_rows(self, rows, index): self._write_data(rows, sl=index) else: cr_list = [] - for i, cr in enumerate(rows): + for cr in rows: cr_list.append(tuple(cr)) self._write_data(cr_list, sl=index) diff --git a/nixio/file.py b/nixio/file.py index a2985549..494e5a1b 100644 --- a/nixio/file.py +++ b/nixio/file.py @@ -46,8 +46,8 @@ def can_read(nixfile): filever = nixfile.version if len(filever) != 3: raise RuntimeError("Invalid version specified in file.") - vx, vy, vz = HDF_FF_VERSION - fx, fy, fz = filever + vx, vy, _ = HDF_FF_VERSION + fx, fy, _ = filever if vx == fx and vy >= fy: return True else: diff --git a/nixio/section.py b/nixio/section.py index d3a14ab5..ce5f1295 100644 --- a/nixio/section.py +++ b/nixio/section.py @@ -469,7 +469,7 @@ def __setitem__(self, key, data): prop.values = data def __iter__(self): - for name, item in self.items(): + for _, item in self.items(): yield item def items(self): diff --git a/nixio/test/test_multi_tag.py b/nixio/test/test_multi_tag.py index 628e8894..beb491f1 100644 --- a/nixio/test/test_multi_tag.py +++ b/nixio/test/test_multi_tag.py @@ -432,8 +432,8 @@ def test_multi_tag_tagged_data(self): assert (segdata.shape == (1, 5, 1)) # retrieve all positions for all references - for ridx, ref in enumerate(mtag.references): - for pidx, p in enumerate(mtag.positions): + for ridx, _ in enumerate(mtag.references): + for pidx, _ in enumerate(mtag.positions): mtag.tagged_data(pidx, ridx) wrong_pos = self.block.create_data_array("incorpos", "test", @@ -462,7 +462,7 @@ def test_multi_tag_tagged_data_1d(self): onedmtag = self.block.create_multi_tag("2dmt", "mtag", positions=onedpos) onedmtag.references.append(oneddata) - for pidx, p in enumerate(onedmtag.positions): + for pidx, _ in enumerate(onedmtag.positions): onedmtag.tagged_data(pidx, 0) def test_multi_tag_feature_data(self): diff --git a/nixio/test/xcompat/compile.py b/nixio/test/xcompat/compile.py index 39dbd3f2..cce15099 100644 --- a/nixio/test/xcompat/compile.py +++ b/nixio/test/xcompat/compile.py @@ -41,7 +41,7 @@ def cc(filenames, dest, objnames = compiler.compile(filenames, output_dir=dest, extra_postargs=compile_args) for obj in objnames: - execname, ext = os.path.splitext(obj) + execname, _ = os.path.splitext(obj) compiler.link_executable( [obj], execname, output_dir=dest, target_lang="c++", diff --git a/nixio/util/units.py b/nixio/util/units.py index 536f9cdb..8a59d59b 100644 --- a/nixio/util/units.py +++ b/nixio/util/units.py @@ -137,8 +137,8 @@ def scalable(unit_a, unit_b): if not (is_si(unit_a) and is_si(unit_b)): return False - a_prefix, a_unit, a_power = split(unit_a) - b_prefix, b_unit, b_power = split(unit_b) + _, a_unit, a_power = split(unit_a) + _, b_unit, b_power = split(unit_b) if a_unit != b_unit or a_power != b_power: return False @@ -163,8 +163,8 @@ def scaling(origin, destination): "nixio.util.scaling" ) - org_prefix, org_unit, org_power = split(origin) - dest_prefix, dest_unit, dest_power = split(destination) + org_prefix, _, org_power = split(origin) + dest_prefix, _, dest_power = split(destination) if org_prefix == dest_prefix and org_power == dest_power: return scale