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