Skip to content

Commit

Permalink
Refactor remaining scripts
Browse files Browse the repository at this point in the history
Refs #11144
  • Loading branch information
DanNixon committed Feb 23, 2015
1 parent a966d3b commit efcd988
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 15 deletions.
Expand Up @@ -149,7 +149,7 @@ def _calculateFinalYAxis(self, bNumerator=True):
ws_event_data = LoadEventNexus(Filename=nexus_file_numerator,
OutputWorkspace='EventDataWks')
mt1 = mtd['EventDataWks']

is_nexus_detector_rotated_flag = wks_utility.isNexusTakeAfterRefDate(ws_event_data.getRun().getProperty('run_start').value)
if is_nexus_detector_rotated_flag:
self.alpha_pixel_nbr = 304
Expand Down Expand Up @@ -376,7 +376,7 @@ def plotObject(instance):
linestyle='',
label='Exp. data')

if (instance.a is not None):
if instance.a is not None:
x = linspace(10000, 22000, 100)
_label = "%.3f + x*%.2e" % (instance.a, instance.b)
plot(x, instance.a + instance.b * x, label=_label)
Expand Down
3 changes: 2 additions & 1 deletion Code/Mantid/scripts/LargeScaleStructures/geometry_writer.py
Expand Up @@ -2,7 +2,8 @@
from xml.dom.minidom import getDOMImplementation
from datetime import datetime
import re
class MantidGeom:

class MantidGeom(object):

def __init__(self, instname, valid_from=None):
if valid_from is None:
Expand Down
10 changes: 10 additions & 0 deletions Code/Mantid/scripts/PyChop/fluxGUI.py
Expand Up @@ -13,6 +13,16 @@

class MainWindow(QtGui.QMainWindow):

flux_matrix = None
flux_energies = None
res_matrix = None
res_energies = None
frequencies = None
ei = None
ei_min = None
ei_max = None
interpolation = None

def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self,parent)
self.ui = Ui_MainWindow()
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/scripts/reducer_singleton.py
Expand Up @@ -35,7 +35,7 @@ def execute(self, reducer, inputworkspace=None, outputworkspace=None):
@param inputworkspace: Name of the workspace to apply this step to
@param outputworkspace: Name of the workspace to have as an output. If this is None it will be set to inputworkspace
"""
raise NotImplemented
raise NotImplementedError

class Reducer(object):
"""
Expand Down Expand Up @@ -159,7 +159,7 @@ def reduce(self):



class ReductionSingleton:
class ReductionSingleton(object):
""" Singleton reduction class """

## storage for the instance reference
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/scripts/reduction/__init__.py
@@ -1,3 +1,3 @@
from reducer import *
from instrument import *
from find_data import find_data, find_file
from reduction.reducer import *
from reduction.instrument import *
from reduction.find_data import find_data, find_file
4 changes: 2 additions & 2 deletions Code/Mantid/scripts/reduction/command_interface.py
Expand Up @@ -3,9 +3,9 @@
List of user commands.
"""

from reducer import Reducer
from reduction.reducer import Reducer

class ReductionSingleton:
class ReductionSingleton(object):
""" Singleton reduction class """

## storage for the instance reference
Expand Down
6 changes: 3 additions & 3 deletions Code/Mantid/scripts/reduction/reducer.py
Expand Up @@ -23,14 +23,14 @@
import time
import types
import inspect
from instrument import Instrument
from reduction.instrument import Instrument
import mantid
from mantid import simpleapi
import warnings
import inspect
import random
import string
from find_data import find_data
from reduction.find_data import find_data


## Version number
Expand Down Expand Up @@ -538,7 +538,7 @@ def execute(self, reducer, inputworkspace=None, outputworkspace=None):
@param inputworkspace: Name of the workspace to apply this step to
@param outputworkspace: Name of the workspace to have as an output. If this is None it will be set to inputworkspace
"""
raise NotImplemented
raise NotImplementedError


def extract_workspace_name(filepath, suffix=''):
Expand Down
4 changes: 2 additions & 2 deletions Code/Mantid/scripts/reduction_workflow/command_interface.py
Expand Up @@ -3,9 +3,9 @@
List of user commands.
"""

from reducer import Reducer
from reduction_workflow.reducer import Reducer

class ReductionSingleton:
class ReductionSingleton(object):
""" Singleton reduction class """

## storage for the instance reference
Expand Down

0 comments on commit efcd988

Please sign in to comment.