Commit 2c239f9e authored by Conor Finn's avatar Conor Finn
Browse files

RE #27722 autopep8 E302 Expected blank lines

parent 4e16602f
...@@ -18,6 +18,7 @@ import inspect ...@@ -18,6 +18,7 @@ import inspect
import sys import sys
import dis import dis
def replace_signature(func, signature): def replace_signature(func, signature):
""" """
Replace the signature of the given function object with that given by Replace the signature of the given function object with that given by
...@@ -74,6 +75,8 @@ def customise_func(func, name, signature, docstring): ...@@ -74,6 +75,8 @@ def customise_func(func, name, signature, docstring):
return func return func
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
def decompile(code_object): def decompile(code_object):
""" """
Taken from Taken from
...@@ -128,6 +131,7 @@ __operator_names = set(['CALL_FUNCTION', 'CALL_FUNCTION_VAR', 'CALL_FUNCTION_KW' ...@@ -128,6 +131,7 @@ __operator_names = set(['CALL_FUNCTION', 'CALL_FUNCTION_VAR', 'CALL_FUNCTION_KW'
'CALL_FUNCTION_EX', 'LOAD_METHOD', 'CALL_METHOD']) 'CALL_FUNCTION_EX', 'LOAD_METHOD', 'CALL_METHOD'])
#-------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------
def process_frame(frame): def process_frame(frame):
"""Returns the number of arguments on the left of assignment along """Returns the number of arguments on the left of assignment along
with the names of the variables for the given frame. with the names of the variables for the given frame.
...@@ -216,6 +220,7 @@ def process_frame(frame): ...@@ -216,6 +220,7 @@ def process_frame(frame):
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
def lhs_info(output_type='both', frame=None): def lhs_info(output_type='both', frame=None):
"""Returns the number of arguments on the left of assignment along """Returns the number of arguments on the left of assignment along
with the names of the variables. with the names of the variables.
......
...@@ -38,6 +38,7 @@ from . import logger, Logger, config ...@@ -38,6 +38,7 @@ from . import logger, Logger, config
# String that separates paths (should be in the ConfigService) # String that separates paths (should be in the ConfigService)
PATH_SEPARATOR=";" PATH_SEPARATOR=";"
class PluginLoader(object): class PluginLoader(object):
extension = ".py" extension = ".py"
...@@ -68,6 +69,7 @@ class PluginLoader(object): ...@@ -68,6 +69,7 @@ class PluginLoader(object):
# High-level functions to assist with loading # High-level functions to assist with loading
#====================================================================================================================== #======================================================================================================================
def get_plugin_paths_as_set(key): def get_plugin_paths_as_set(key):
""" """
Returns the value of the given key in the config service Returns the value of the given key in the config service
...@@ -81,6 +83,7 @@ def get_plugin_paths_as_set(key): ...@@ -81,6 +83,7 @@ def get_plugin_paths_as_set(key):
s.remove('') s.remove('')
return s return s
def check_for_plugins(top_dir): def check_for_plugins(top_dir):
""" """
Runs a quick check to see if any plugin files exist in the given directory Runs a quick check to see if any plugin files exist in the given directory
...@@ -119,6 +122,7 @@ def find_plugins(top_dir): ...@@ -119,6 +122,7 @@ def find_plugins(top_dir):
#====================================================================================================================== #======================================================================================================================
def load(path): def load(path):
""" """
High-level function to import the module(s) on the given path. High-level function to import the module(s) on the given path.
...@@ -151,6 +155,7 @@ def load(path): ...@@ -151,6 +155,7 @@ def load(path):
#====================================================================================================================== #======================================================================================================================
def load_from_list(paths): def load_from_list(paths):
""" """
Load all modules in the given list Load all modules in the given list
...@@ -168,6 +173,7 @@ def load_from_list(paths): ...@@ -168,6 +173,7 @@ def load_from_list(paths):
#====================================================================================================================== #======================================================================================================================
def load_from_dir(directory): def load_from_dir(directory):
""" """
Load all modules in the given directory Load all modules in the given directory
...@@ -183,6 +189,7 @@ def load_from_dir(directory): ...@@ -183,6 +189,7 @@ def load_from_dir(directory):
#====================================================================================================================== #======================================================================================================================
def load_from_file(filepath): def load_from_file(filepath):
""" """
Loads the plugin file. Any code present at the top-level will Loads the plugin file. Any code present at the top-level will
...@@ -200,6 +207,7 @@ def load_from_file(filepath): ...@@ -200,6 +207,7 @@ def load_from_file(filepath):
#====================================================================================================================== #======================================================================================================================
def load_plugin(plugin_path): def load_plugin(plugin_path):
""" """
Load a plugin and return the name & module object Load a plugin and return the name & module object
...@@ -215,6 +223,7 @@ def load_plugin(plugin_path): ...@@ -215,6 +223,7 @@ def load_plugin(plugin_path):
#====================================================================================================================== #======================================================================================================================
def sync_attrs(source, attrs, clients): def sync_attrs(source, attrs, clients):
""" """
Syncs the attribute definitions between the Syncs the attribute definitions between the
...@@ -234,6 +243,7 @@ def sync_attrs(source, attrs, clients): ...@@ -234,6 +243,7 @@ def sync_attrs(source, attrs, clients):
#====================================================================================================================== #======================================================================================================================
def contains_algorithm(filename): def contains_algorithm(filename):
""" """
Inspects the file to look for an algorithm registration line Inspects the file to look for an algorithm registration line
......
...@@ -19,6 +19,8 @@ LOGGER = Logger("mantid.plots.plotCompatability") ...@@ -19,6 +19,8 @@ LOGGER = Logger("mantid.plots.plotCompatability")
# ================================================ # ================================================
# Compatability functions # Compatability functions
# ================================================ # ================================================
def plotSpectrum(workspaces, indices=None, distribution=None, error_bars=False, def plotSpectrum(workspaces, indices=None, distribution=None, error_bars=False,
type=None, window=None, clearWindow=None, type=None, window=None, clearWindow=None,
waterfall=None, spectrum_nums=None): waterfall=None, spectrum_nums=None):
......
...@@ -35,6 +35,8 @@ WATERFALL_XOFFSET_DEFAULT, WATERFALL_YOFFSET_DEFAULT = 10, 20 ...@@ -35,6 +35,8 @@ WATERFALL_XOFFSET_DEFAULT, WATERFALL_YOFFSET_DEFAULT = 10, 20
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Decorators # Decorators
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
def plot_decorator(func): def plot_decorator(func):
def wrapper(self, *args, **kwargs): def wrapper(self, *args, **kwargs):
func_value = func(self, *args, **kwargs) func_value = func(self, *args, **kwargs)
...@@ -56,6 +58,8 @@ def plot_decorator(func): ...@@ -56,6 +58,8 @@ def plot_decorator(func):
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# MantidAxes # MantidAxes
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
class MantidAxes(Axes): class MantidAxes(Axes):
""" """
This class defines the **mantid** projection for 2d plotting. One chooses This class defines the **mantid** projection for 2d plotting. One chooses
...@@ -1101,6 +1105,8 @@ class MantidAxes(Axes): ...@@ -1101,6 +1105,8 @@ class MantidAxes(Axes):
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# MantidAxes3D # MantidAxes3D
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
class MantidAxes3D(Axes3D): class MantidAxes3D(Axes3D):
""" """
This class defines the **mantid3d** projection for 3d plotting. One chooses This class defines the **mantid3d** projection for 3d plotting. One chooses
......
...@@ -40,6 +40,8 @@ MARKER_MAP = {'square': 's', 'plus (filled)': 'P', 'point': '.', 'tickdown': 3, ...@@ -40,6 +40,8 @@ MARKER_MAP = {'square': 's', 'plus (filled)': 'P', 'point': '.', 'tickdown': 3,
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Decorators # Decorators
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
def manage_workspace_names(func): def manage_workspace_names(func):
""" """
A decorator to go around plotting functions. A decorator to go around plotting functions.
...@@ -81,6 +83,7 @@ def figure_title(workspaces, fig_num): ...@@ -81,6 +83,7 @@ def figure_title(workspaces, fig_num):
return wsname(first) + '-' + str(fig_num) return wsname(first) + '-' + str(fig_num)
@manage_workspace_names @manage_workspace_names
def plot(workspaces, spectrum_nums=None, wksp_indices=None, errors=False, def plot(workspaces, spectrum_nums=None, wksp_indices=None, errors=False,
overplot=False, fig=None, plot_kwargs=None, ax_properties=None, overplot=False, fig=None, plot_kwargs=None, ax_properties=None,
......
...@@ -10,6 +10,8 @@ from mantid.kernel import * ...@@ -10,6 +10,8 @@ from mantid.kernel import *
from distutils.version import LooseVersion from distutils.version import LooseVersion
import numpy as np import numpy as np
import os import os
class ExportSampleLogsToCSVFile(PythonAlgorithm): class ExportSampleLogsToCSVFile(PythonAlgorithm):
""" Python algorithm to export sample logs to spread sheet file """ Python algorithm to export sample logs to spread sheet file
for VULCAN for VULCAN
......
...@@ -20,6 +20,8 @@ from mantid.simpleapi import * ...@@ -20,6 +20,8 @@ from mantid.simpleapi import *
from mantid.kernel import * from mantid.kernel import *
from reduction_gui.reduction.reflectometer.refl_data_series import DataSeries from reduction_gui.reduction.reflectometer.refl_data_series import DataSeries
from reduction_gui.reduction.reflectometer.refl_data_script import DataSets from reduction_gui.reduction.reflectometer.refl_data_script import DataSets
class LRAutoReduction(PythonAlgorithm): class LRAutoReduction(PythonAlgorithm):
def category(self): def category(self):
......
...@@ -10,6 +10,8 @@ import re ...@@ -10,6 +10,8 @@ import re
from mantid.api import * from mantid.api import *
from mantid.simpleapi import * from mantid.simpleapi import *
from mantid.kernel import * from mantid.kernel import *
class LRScalingFactors(PythonAlgorithm): class LRScalingFactors(PythonAlgorithm):
""" """
This algorithm runs through a sequence of direct beam data sets This algorithm runs through a sequence of direct beam data sets
......
...@@ -12,6 +12,7 @@ from mantid import config ...@@ -12,6 +12,7 @@ from mantid import config
import os import os
from itertools import filterfalse from itertools import filterfalse
class Intervals(object): class Intervals(object):
# Having "*intervals" as a parameter instead of "intervals" allows us # Having "*intervals" as a parameter instead of "intervals" allows us
# to type "Intervals( (0,3), (6, 8) )" instead of "Intervals( ( (0,3), (6, 8) ) )" # to type "Intervals( (0,3), (6, 8) )" instead of "Intervals( ( (0,3), (6, 8) ) )"
......
...@@ -9,6 +9,7 @@ from mantid.simpleapi import * ...@@ -9,6 +9,7 @@ from mantid.simpleapi import *
from mantid.kernel import * from mantid.kernel import *
from mantid.api import * from mantid.api import *
class SelectNexusFilesByMetadata(PythonAlgorithm): class SelectNexusFilesByMetadata(PythonAlgorithm):
_criteria_splitted = [] _criteria_splitted = []
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
from mantid.simpleapi import * from mantid.simpleapi import *
from mantid.api import * from mantid.api import *
from mantid.kernel import * from mantid.kernel import *
class MSDFit(DataProcessorAlgorithm): class MSDFit(DataProcessorAlgorithm):
_output_fit_ws = None _output_fit_ws = None
_model = None _model = None
......
...@@ -9,6 +9,8 @@ from mantid.api import * ...@@ -9,6 +9,8 @@ from mantid.api import *
from mantid.kernel import * from mantid.kernel import *
import os import os
import sys import sys
def simple_algorithm(algorithm_str, parameters): def simple_algorithm(algorithm_str, parameters):
return _execute(algorithm_str, parameters) return _execute(algorithm_str, parameters)
......
...@@ -13,6 +13,8 @@ import numpy ...@@ -13,6 +13,8 @@ import numpy
import sys import sys
import os import os
import json import json
class USANSReduction(PythonAlgorithm): class USANSReduction(PythonAlgorithm):
wl_list = None wl_list = None
......
...@@ -8,6 +8,7 @@ import unittest ...@@ -8,6 +8,7 @@ import unittest
from mantid.api import AlgorithmFactory from mantid.api import AlgorithmFactory
class ImportModuleTest(unittest.TestCase): class ImportModuleTest(unittest.TestCase):
def test_import_succeeds(self): def test_import_succeeds(self):
......
...@@ -18,6 +18,7 @@ from mantid.api import mtd, MatrixWorkspace, ITableWorkspace, IFunction ...@@ -18,6 +18,7 @@ from mantid.api import mtd, MatrixWorkspace, ITableWorkspace, IFunction
import numpy as np import numpy as np
from testhelpers import run_algorithm from testhelpers import run_algorithm
class SimpleAPIFitTest(unittest.TestCase): class SimpleAPIFitTest(unittest.TestCase):
_raw_ws = None _raw_ws = None
......
...@@ -11,6 +11,7 @@ import unittest ...@@ -11,6 +11,7 @@ import unittest
from mantid.simpleapi import Load, LoadDialog from mantid.simpleapi import Load, LoadDialog
from mantid.api import mtd, MatrixWorkspace, WorkspaceGroup from mantid.api import mtd, MatrixWorkspace, WorkspaceGroup
class SimpleAPILoadTest(unittest.TestCase): class SimpleAPILoadTest(unittest.TestCase):
def tearDown(self): def tearDown(self):
......
...@@ -13,6 +13,7 @@ import platform ...@@ -13,6 +13,7 @@ import platform
from mantid.api import mtd from mantid.api import mtd
from mantid.simpleapi import CreateSampleWorkspace,RenameWorkspace from mantid.simpleapi import CreateSampleWorkspace,RenameWorkspace
class SimpleAPIRenameWorkspaceTest(unittest.TestCase): class SimpleAPIRenameWorkspaceTest(unittest.TestCase):
_raw_ws = None _raw_ws = None
......
...@@ -9,6 +9,8 @@ from mantid.simpleapi import CreateWorkspace, set_properties ...@@ -9,6 +9,8 @@ from mantid.simpleapi import CreateWorkspace, set_properties
from mantid.api import (MatrixWorkspaceProperty, AlgorithmFactory, AlgorithmManager, from mantid.api import (MatrixWorkspaceProperty, AlgorithmFactory, AlgorithmManager,
DataProcessorAlgorithm, PythonAlgorithm) DataProcessorAlgorithm, PythonAlgorithm)
from mantid.kernel import Direction from mantid.kernel import Direction
class ChildAlg(PythonAlgorithm): class ChildAlg(PythonAlgorithm):
def PyInit(self): def PyInit(self):
......
...@@ -10,6 +10,7 @@ import json ...@@ -10,6 +10,7 @@ import json
from mantid.api import AlgorithmID, AlgorithmManager, FrameworkManagerImpl from mantid.api import AlgorithmID, AlgorithmManager, FrameworkManagerImpl
from testhelpers import run_algorithm from testhelpers import run_algorithm
class AlgorithmTest(unittest.TestCase): class AlgorithmTest(unittest.TestCase):
_load = None _load = None
......
...@@ -9,6 +9,7 @@ from testhelpers import run_algorithm ...@@ -9,6 +9,7 @@ from testhelpers import run_algorithm
from mantid.api import NumericAxis, SpectraAxis, TextAxis, mtd from mantid.api import NumericAxis, SpectraAxis, TextAxis, mtd
import numpy as np import numpy as np
class AxisTest(unittest.TestCase): class AxisTest(unittest.TestCase):
_test_ws = None _test_ws = None
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment