Skip to content

Commit bc4859b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent e1b31a3 commit bc4859b

File tree

577 files changed

+973
-1219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

577 files changed

+973
-1219
lines changed

Framework/DataObjects/src/generate_mdevent_declarations.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
# NScD Oak Ridge National Laboratory, European Spallation Source,
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
7-
""" Simple script that generates references to all
8-
needed MDEvent<X>/MDLeanEvent<X> instantiations. """
7+
"""Simple script that generates references to all
8+
needed MDEvent<X>/MDLeanEvent<X> instantiations."""
9+
910
import os
1011
import datetime
1112
import re
@@ -25,9 +26,7 @@
2526

2627
footer = """
2728
/* CODE ABOWE WAS AUTO-GENERATED BY %s - DO NOT EDIT! */
28-
""" % (
29-
os.path.basename(__file__)
30-
)
29+
""" % (os.path.basename(__file__))
3130

3231

3332
def build_macro(padding, min_dimension=1, max_dimensions=4, const=""):

Framework/PythonInterface/mantid/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
2424
"""
2525

26-
2726
import os
2827
import sys
2928

Framework/PythonInterface/mantid/_plugins/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
are used for checks such as isinstance()
2121
"""
2222

23-
2423
###############################################################################
2524
# Load the C++ library and register the C++ class exports
2625
###############################################################################

Framework/PythonInterface/mantid/api/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Defines Python objects that wrap the C++ API namespace.
1212
1313
"""
14+
1415
###############################################################################
1516
# Load the C++ library
1617
###############################################################################

Framework/PythonInterface/mantid/api/_adsimports.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
"""
8-
This modules provides a function, importAllFromADS, that creates a python
9-
variable in the globals dict of the current frame for each
10-
name in the analysis data service.
8+
This modules provides a function, importAllFromADS, that creates a python
9+
variable in the globals dict of the current frame for each
10+
name in the analysis data service.
1111
12-
If the name is not a valid variable then no variable is created.
12+
If the name is not a valid variable then no variable is created.
1313
14-
The function is also attached to the AnalysisDataService and named importAll.
14+
The function is also attached to the AnalysisDataService and named importAll.
1515
1616
"""
17+
1718
from mantid.api import AnalysisDataServiceImpl
1819
import inspect as _inspect
1920
import keyword as _keyword

Framework/PythonInterface/mantid/api/_aliases.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
"""
8-
Defines a set of aliases to make accessing certain objects easier
8+
Defines a set of aliases to make accessing certain objects easier
99
"""
10+
1011
from mantid.api import (
1112
AlgorithmFactoryImpl,
1213
AlgorithmManagerImpl,

Framework/PythonInterface/mantid/api/_workspaceops.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
"""
8-
This module adds functions to the Workspace classes
9-
so that Python operators, i.e +-*/, can be used on them
8+
This module adds functions to the Workspace classes
9+
so that Python operators, i.e +-*/, can be used on them
1010
11-
It is intended for internal use.
11+
It is intended for internal use.
1212
"""
1313

14-
1514
import inspect as _inspect
1615

1716
from mantid.api import AnalysisDataServiceImpl, ITableWorkspace, Workspace, WorkspaceGroup, performBinaryOp

Framework/PythonInterface/mantid/dataobjects/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
The names from the library are not imported by default as it is best if the interface classes
2020
are used for checks such as isinstance()
2121
"""
22+
2223
###############################################################################
2324
# Load the C++ library and register the C++ class exports
2425
###############################################################################

Framework/PythonInterface/mantid/fitfunctions.py

+1
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,7 @@ def _create_wrapper_function(name):
781781
782782
:param name: name of fake function
783783
"""
784+
784785
# ------------------------------------------------------------------------------------------------
785786
def wrapper_function(*args, **kwargs):
786787
return FunctionWrapper.wrap(name, *args, **kwargs)

Framework/PythonInterface/mantid/geometry/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Defines Python objects that wrap the C++ Geometry namespace.
1212
1313
"""
14+
1415
###############################################################################
1516
# Load the C++ library
1617
###############################################################################

Framework/PythonInterface/mantid/geometry/_aliases.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
"""
8-
Defines a set of aliases to make accessing certain objects easier,
9-
like in mantid.api.
8+
Defines a set of aliases to make accessing certain objects easier,
9+
like in mantid.api.
1010
"""
1111

12-
1312
from mantid.kernel._aliases import lazy_instance_access
1413
from mantid.geometry import SpaceGroupFactoryImpl, SymmetryOperationFactoryImpl, SymmetryElementFactoryImpl, PointGroupFactoryImpl
1514

Framework/PythonInterface/mantid/kernel/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
Defines Python objects that wrap the C++ Kernel namespace.
1212
1313
"""
14+
1415
###############################################################################
1516
# Make modules available in this namespace
1617
###############################################################################

Framework/PythonInterface/mantid/kernel/_aliases.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
"""
8-
Defines a set of aliases for the kernel module to make
9-
accessing certain objects easier.
8+
Defines a set of aliases for the kernel module to make
9+
accessing certain objects easier.
1010
"""
1111

12-
1312
from mantid.kernel import ConfigServiceImpl, Logger, PropertyManagerDataServiceImpl, UnitFactoryImpl, UsageServiceImpl
1413

1514

Framework/PythonInterface/mantid/kernel/environment.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
"""
8-
Defines a set functions for interrogating the current environment.
8+
Defines a set functions for interrogating the current environment.
99
10-
The standard platform module doesn't have simple things like is_windows(),
11-
is_linux(). The set of functions defined here should make it clearer what is going
12-
on when they are used.
10+
The standard platform module doesn't have simple things like is_windows(),
11+
is_linux(). The set of functions defined here should make it clearer what is going
12+
on when they are used.
1313
"""
14+
1415
import platform as _platform
1516
import sys as _sys
1617
import os.path as _osp

Framework/PythonInterface/mantid/kernel/funcinspect.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
66
# SPDX - License - Identifier: GPL - 3.0 +
77
"""
8-
Defines functions that can be used to inspect the properties of a
9-
function call. For example
8+
Defines functions that can be used to inspect the properties of a
9+
function call. For example
1010
11-
lhs_info() can be used to get retrieve the names and number of
12-
arguments that are being assigned to a function
13-
return
11+
lhs_info() can be used to get retrieve the names and number of
12+
arguments that are being assigned to a function
13+
return
1414
"""
1515

1616
import inspect

Framework/PythonInterface/mantid/kernel/plugins.py

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
algorithms, fit functions etc.
1212
"""
1313

14-
1514
import os as _os
1615
from traceback import format_exc
1716
import sys

Framework/PythonInterface/mantid/plots/legend.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"""
1111
Functionality for dealing with legends on plots
1212
"""
13+
1314
from packaging.version import Version
1415

1516
import matplotlib

Framework/PythonInterface/mantid/plots/mantidimage.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(
3232
filternorm=filternorm,
3333
filterrad=filterrad,
3434
resample=resample,
35-
**kwargs
35+
**kwargs,
3636
)
3737

3838
def calculate_greyscale_intensity(self) -> ImageIntensity:

Framework/PythonInterface/mantid/plots/modest_image/modest_image.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828

2929
class ModestImage(MantidImage):
30-
3130
"""
3231
Computationally modest image class.
3332
@@ -246,7 +245,7 @@ def imshow(
246245
resample=None,
247246
url=None,
248247
transpose=None,
249-
**kwargs
248+
**kwargs,
250249
):
251250
"""Similar to matplotlib's imshow command, but produces a ModestImage
252251
@@ -268,7 +267,7 @@ def imshow(
268267
filterrad=filterrad,
269268
resample=resample,
270269
transpose=transpose,
271-
**kwargs
270+
**kwargs,
272271
)
273272

274273
im.set_data(X)

Framework/PythonInterface/mantid/plots/resampling_image/samplingimage.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(
2929
filterrad=4.0,
3030
resample=False,
3131
normalize_by_bin_width=None,
32-
**kwargs
32+
**kwargs,
3333
):
3434
super().__init__(
3535
ax,
@@ -41,7 +41,7 @@ def __init__(
4141
filternorm=filternorm,
4242
filterrad=filterrad,
4343
resample=resample,
44-
**kwargs
44+
**kwargs,
4545
)
4646
self.ws = workspace
4747
try:
@@ -243,7 +243,7 @@ def imshow_sampling(
243243
filterrad=filterrad,
244244
resample=resample,
245245
normalize_by_bin_width=normalize_by_bin_width,
246-
**kwargs
246+
**kwargs,
247247
)
248248
im._resample_image(100, 100)
249249

Framework/PythonInterface/mantid/plots/scales.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"""
99
Defines a set of custom axis scales
1010
"""
11+
1112
from matplotlib.scale import ScaleBase
1213
from matplotlib.ticker import AutoLocator, NullFormatter, NullLocator, ScalarFormatter
1314
from matplotlib.transforms import Transform

Framework/PythonInterface/mantid/py36compat/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Python versions (3.7 onwards) to Ubuntu 18.04 / RHEL 7
1414
which are both on Python 3.6.
1515
"""
16+
1617
import sys
1718

1819
__requires_compat = False if sys.version_info[0:2] > (3, 6) else True

Framework/PythonInterface/mantid/simpleapi.py

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
2727
Importing this module starts the FrameworkManager instance.
2828
"""
29+
2930
# std libs
3031
from collections import OrderedDict, namedtuple
3132
from contextlib import contextmanager

Framework/PythonInterface/mantid/utils/dgs/_geometry.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ def qangle(
300300
] = ErrorCodes.INSIDE_BEAMSTOP
301301

302302
if goniometer_constraints:
303-
error_code[
304-
((omega < goniometer_range[0]) | (omega > goniometer_range[1])) & (error_code == ErrorCodes.CORRECT)
305-
] = ErrorCodes.GONIOMETR
303+
error_code[((omega < goniometer_range[0]) | (omega > goniometer_range[1])) & (error_code == ErrorCodes.CORRECT)] = (
304+
ErrorCodes.GONIOMETR
305+
)
306306

307307
return dict(
308308
Q_lab_x=Q_lab_x,

Framework/PythonInterface/mantid/utils/nomad/diagnostics.py

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
class CollimationLevel(enum.Enum):
2222
r"""Collimation state of an eight-pack"""
23+
2324
Empty = 0
2425
Half = 1
2526
Full = 2

Framework/PythonInterface/plugins/algorithms/AlignAndFocusPowderFromFiles.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ def __processFile(self, filename, file_prog_start, determineCharacterizations, c
453453
progstart=prog_start,
454454
progstop=prog_start + prog_per_chunk_step,
455455
filterBadPulses=self.filterBadPulses,
456-
**chunk
456+
**chunk,
457457
)
458458
loader.execute()
459459
if j == 0:
@@ -533,7 +533,7 @@ def __processFile(self, filename, file_prog_start, determineCharacterizations, c
533533
UnfocussedWorkspace=unfocusname_chunk,
534534
startProgress=prog_start,
535535
endProgress=prog_start + 2.0 * prog_per_chunk_step,
536-
**self.kwargs
536+
**self.kwargs,
537537
)
538538
prog_start += 2.0 * prog_per_chunk_step # AlignAndFocusPowder counts for two steps
539539

Framework/PythonInterface/plugins/algorithms/ApplyNegMuCorrection.py

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313

1414
class ApplyNegMuCorrection(PythonAlgorithm):
15-
1615
# Combining work spaces and normalising the correction.
1716
# _OILE and _OIHE are unused parameters for now to make PyLint happy
1817
def combine(self, dataDir, runno, A2000, B2000, A3000, B3000, _OILE, _OIHE, spec):
@@ -85,7 +84,6 @@ def category(self):
8584
return "CorrectionFunctions\\SpecialCorrections;Muon"
8685

8786
def PyExec(self):
88-
8987
spec = 1
9088
dataDir = self.getProperty("DataDirectory").value
9189
first = self.getProperty("FirstRunNumber").value

Framework/PythonInterface/plugins/algorithms/BASISCrystalDiffraction.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ def pyexec_setup(new_options):
105105

106106

107107
class BASISCrystalDiffraction(DataProcessorAlgorithm):
108-
109108
_mask_file = "/SNS/BSS/shared/autoreduce/new_masks_08_12_2015/" "BASIS_Mask_default_diff.xml"
110109
_solid_angle_ws_ = "/SNS/BSS/shared/autoreduce/solid_angle_diff.nxs"
111110
_flux_ws_ = "/SNS/BSS/shared/autoreduce/int_flux.nxs"
@@ -419,7 +418,7 @@ def _determine_single_crystal_diffraction(self):
419418
OutputNormalizationWorkspace="_t_norm",
420419
TemporaryDataWorkspace="_t_data" if mtd.doesExist("_t_data") else None,
421420
TemporaryNormalizationWorkspace="_t_norm" if mtd.doesExist("_t_norm") else None,
422-
**md_norm_scd_kwargs
421+
**md_norm_scd_kwargs,
423422
)
424423
if self._bkg:
425424
MDNormSCD(
@@ -428,7 +427,7 @@ def _determine_single_crystal_diffraction(self):
428427
OutputNormalizationWorkspace="_t_bkg_norm",
429428
TemporaryDataWorkspace="_t_bkg_data" if mtd.doesExist("_t_bkg_data") else None,
430429
TemporaryNormalizationWorkspace="_t_bkg_norm" if mtd.doesExist("_t_bkg_norm") else None,
431-
**md_norm_scd_kwargs
430+
**md_norm_scd_kwargs,
432431
)
433432
message = "Processing sample {} of {}".format(i_run + 1, len(run_numbers))
434433
diffraction_reporter.report(message)

0 commit comments

Comments
 (0)