Skip to content

Commit

Permalink
Refs #10702. Addressing some pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wedel committed Mar 2, 2015
1 parent e4db272 commit 1e08324
Showing 1 changed file with 14 additions and 10 deletions.
@@ -1,3 +1,4 @@
#pylint: disable=no-init,invalid-name
from mantid.api import *
from mantid.kernel import *
from mantid.simpleapi import *
Expand All @@ -6,7 +7,7 @@
from pyparsing import *


class PoldiSample:
class PoldiSample(Object):
def __init__(self, initString):

self._name, self._runList = self.parseInitString(initString)
Expand Down Expand Up @@ -62,7 +63,7 @@ def parseRunRangeString(self, runRangeString):
return runList


class PoldiProject:
class PoldiProject(Object):
def __init__(self, projectName, sampleListFile):
self._name = projectName
self._sampleList = self.parseSampleListFile(sampleListFile)
Expand All @@ -77,18 +78,21 @@ def parseSampleListFile(self, sampleListFile):
fh = open(sampleListFile, 'r')

sampleList = []
for line in fh:
if len(line.strip()) > 0 and not line.strip()[0] == '#':
sampleList.append(PoldiSample(line))
for sampleFileLine in fh:
if len(sampleFileLine.strip()) > 0 and not sampleFileLine.strip()[0] == '#':
sampleList.append(PoldiSample(sampleFileLine))

return sampleList


class PoldiCompound:
class PoldiCompound(Object):
def __init__(self, name, content, tolerance, elements):
self._name = name
self._content = content
self._tolerance = tolerance
self._spacegroup = ""
self._atomString = ""
self._latticeDict = ""

self.assign(elements)

Expand Down Expand Up @@ -121,7 +125,7 @@ def getName(self):
return self._name


class PoldiCrystalFile:
class PoldiCrystalFile(Object):
elementSymbol = Word(alphas, exact=2)
integerNumber = Word(nums)
decimalSeparator = Literal('.')
Expand Down Expand Up @@ -222,8 +226,8 @@ def PyInit(self):
self.declareProperty(FileProperty(name="CrystalStructures",
defaultValue="",
action=FileAction.Load))
self.declareProperty("Year", 2014, "The year in which the files ")
self.declareProperty("PeakNumber", 10, "Number of peaks to fit.")
self.declareProperty("Year", 2014, "The year in which the data have been recorded.")
self.declareProperty("PeakNumber", 10, "Maximum number of peaks to fit.")

def PyExec(self):
poldiProject = PoldiProject(self.getProperty("ProjectName").valueAsStr,
Expand Down Expand Up @@ -392,4 +396,4 @@ def runPoldiAnalysis(self, dataPointName):
return indexedPeaksWs


AlgorithmFactory.subscribe(PoldiBatchFitIndividualPeaks)
AlgorithmFactory.subscribe(PoldiBatchFitIndividualPeaks)

0 comments on commit 1e08324

Please sign in to comment.