Skip to content

Commit

Permalink
Cleaned up impots in msg_reducer
Browse files Browse the repository at this point in the history
Refs #9093
  • Loading branch information
DanNixon committed Sep 16, 2014
1 parent 2a92909 commit 6f4f555
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions Code/Mantid/scripts/Inelastic/msg_reducer.py
@@ -1,19 +1,16 @@
# Reducers for use by ISIS Molecular Spectroscopy Group

import os.path
import os
import sys
import time
import types
import random
import string

import mantid
from mantid import simpleapi
from mantid import simpleapi, logger
from mantid.simpleapi import *
from mantid.kernel import config
import inelastic_indirect_reduction_steps as steps
from inelastic_indirect_reduction_steps import MSGReductionStep


def extract_workspace_name(filepath, suffix=''):
Expand Down Expand Up @@ -42,7 +39,7 @@ def extract_workspace_name(filepath, suffix=''):
def validate_loader(f):

def validated_f(reducer, algorithm, *args, **kwargs):
if issubclass(algorithm.__class__, MSGReductionStep) or algorithm is None:
if issubclass(algorithm.__class__, steps.MSGReductionStep) or algorithm is None:
# If we have a MSGReductionStep object, just use it.
# "None" is allowed as an algorithm (usually tells the reducer to skip a step)
return f(reducer, algorithm)
Expand All @@ -53,7 +50,7 @@ def validated_f(reducer, algorithm, *args, **kwargs):

if isinstance(algorithm, types.StringType):
# If we have a string, assume it's an algorithm name
class _AlgorithmStep(MSGReductionStep):
class _AlgorithmStep(steps.MSGReductionStep):
def __init__(self):
self.algorithm = None
self._data_file = None
Expand Down Expand Up @@ -119,7 +116,7 @@ def execute(self, reducer, inputworkspace=None, outputworkspace=None):

elif isinstance(algorithm, mantid.api.IAlgorithm) \
or type(algorithm).__name__ == "IAlgorithm":
class _AlgorithmStep(MSGReductionStep):
class _AlgorithmStep(steps.MSGReductionStep):
def __init__(self):
self.algorithm = algorithm
self._data_file = None
Expand Down Expand Up @@ -203,7 +200,7 @@ def validated_f(reducer, algorithm, *args, **kwargs):
@param algorithm: algorithm name, MSGReductionStep object, or Mantid algorithm function
"""
if issubclass(algorithm.__class__, MSGReductionStep) or algorithm is None:
if issubclass(algorithm.__class__, steps.MSGReductionStep) or algorithm is None:
# If we have a MSGReductionStep object, just use it.
# "None" is allowed as an algorithm (usually tells the reducer to skip a step)
return f(reducer, algorithm)
Expand All @@ -214,7 +211,7 @@ def validated_f(reducer, algorithm, *args, **kwargs):

if isinstance(algorithm, types.StringType):
# If we have a string, assume it's an algorithm name
class _AlgorithmStep(MSGReductionStep):
class _AlgorithmStep(steps.MSGReductionStep):
def __init__(self):
self.algorithm = None

Expand Down Expand Up @@ -266,7 +263,7 @@ def execute(self, reducer, inputworkspace=None, outputworkspace=None):

elif isinstance(algorithm, mantid.api.IAlgorithm) \
or type(algorithm).__name__ == "IAlgorithm":
class _AlgorithmStep(MSGReductionStep):
class _AlgorithmStep(steps.MSGReductionStep):
def __init__(self):
self.algorithm = algorithm

Expand Down

0 comments on commit 6f4f555

Please sign in to comment.