diff --git a/src/dxtbx/format/FormatXTC.py b/src/dxtbx/format/FormatXTC.py index cb70f7448..b73a4da17 100644 --- a/src/dxtbx/format/FormatXTC.py +++ b/src/dxtbx/format/FormatXTC.py @@ -6,9 +6,9 @@ from itertools import groupby import numpy as np + import serialtbx.detector.xtc import serialtbx.util - from libtbx.phil import parse from scitbx.array_family import flex @@ -174,7 +174,7 @@ def _load_hit_indices(self): assert self.params.mode == "idx" hits = np.loadtxt(self.params.hits_file, int) hits = list(map(tuple, hits)) - key = lambda x: x[0] + key = lambda x: x[0] # noqa: E731 gb = groupby(sorted(hits, key=key), key=key) # dictionary where key is run number, and vals are indices of hits self._hit_inds = {r: [ind for _, ind in group] for r, group in gb} diff --git a/src/dxtbx/format/nexus.py b/src/dxtbx/format/nexus.py index f1c4c99b3..35dfefaab 100644 --- a/src/dxtbx/format/nexus.py +++ b/src/dxtbx/format/nexus.py @@ -7,7 +7,7 @@ from typing import Iterable, Union import h5py -import hdf5plugin # noqa; F401 +import hdf5plugin # noqa: F401 import numpy import cctbx.uctbx diff --git a/src/dxtbx/imageset.py b/src/dxtbx/imageset.py index 9c2291120..20351bcae 100644 --- a/src/dxtbx/imageset.py +++ b/src/dxtbx/imageset.py @@ -1,5 +1,7 @@ from __future__ import annotations +from typing import Iterable + import natsort import boost_adaptbx.boost.python @@ -31,8 +33,6 @@ ext = boost_adaptbx.boost.python.import_ext("dxtbx_ext") -from typing import Iterable - __all__ = ( "ExternalLookup", "ExternalLookupItemBool", diff --git a/src/dxtbx/util/dlsnxs2cbf.py b/src/dxtbx/util/dlsnxs2cbf.py index 011afe42d..2d45fcf85 100644 --- a/src/dxtbx/util/dlsnxs2cbf.py +++ b/src/dxtbx/util/dlsnxs2cbf.py @@ -5,7 +5,7 @@ from pathlib import Path import h5py -import hdf5plugin # noqa; F401 +import hdf5plugin # noqa: F401 import numpy as np import nxmx import pint diff --git a/tests/nexus/test_nxmx_writer.py b/tests/nexus/test_nxmx_writer.py index aa5538f86..a86d28e8a 100644 --- a/tests/nexus/test_nxmx_writer.py +++ b/tests/nexus/test_nxmx_writer.py @@ -9,12 +9,11 @@ from libtbx.test_utils import approx_equal from dxtbx.format.nexus import h5str +from dxtbx.format.nxmx_writer import NXmxWriter, phil_scope from dxtbx.model.experiment_list import ExperimentListFactory pytest.importorskip("dials") -from dxtbx.format.nxmx_writer import NXmxWriter, phil_scope - def test_writer_jf16M(dials_data, tmpdir): h5path = (