Skip to content

Commit

Permalink
Corrected 2D Miscellaneous Gunary and 2D Peak LorentzianModifiedPeakA…
Browse files Browse the repository at this point in the history
… equations, removed unused variables and imports
  • Loading branch information
zunzun committed Oct 21, 2016
1 parent da1215a commit c76b12e
Show file tree
Hide file tree
Showing 20 changed files with 8 additions and 33 deletions.
2 changes: 1 addition & 1 deletion DataCache/DataCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import sys, os, unittest
import sys, os
if os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..') not in sys.path:
sys.path.append(os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..'))
import pyeq3
Expand Down
1 change: 0 additions & 1 deletion ExtendedVersionHandlers/ExtendedVersionHandler_Default.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
1 change: 0 additions & 1 deletion ExtendedVersionHandlers/ExtendedVersionHandler_Inverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
1 change: 0 additions & 1 deletion ExtendedVersionHandlers/ExtendedVersionHandler_Offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#
# License: BSD-style (see LICENSE.txt in main source directory)

import pyeq3
from . import IExtendedVersionHandler


Expand Down
5 changes: 2 additions & 3 deletions Models_2D/Miscellaneous.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,14 +1384,14 @@ def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):
c = inCoeffs[2]

try:
temp = x_in / (a + b * x_in + x_PowX_half)
temp = x_in / (a + b * x_in + c * x_PowX_half)
return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)
except:
return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300


def SpecificCodeCPP(self):
s = "\ttemp = x_in / (a + b * x_in + pow(x_in, 0.5));\n"
s = "\ttemp = x_in / (a + b * x_in + c * pow(x_in, 0.5));\n"
return s


Expand Down Expand Up @@ -2424,7 +2424,6 @@ def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):
temp = a * numpy.power(x_in, b) * numpy.exp(c / x_NegX)
return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)
except:
x = inDataCacheDictionary['DependentData']
return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300


Expand Down
2 changes: 0 additions & 2 deletions Models_2D/Optical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,6 @@ def GetDataCacheFunctions(self):


def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):
x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once
x_PowX2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once
x_PowX4 = inDataCacheDictionary['PowX_4.0'] # only need to perform this dictionary look-up once
x_PowX6 = inDataCacheDictionary['PowX_6.0'] # only need to perform this dictionary look-up once
Expand Down Expand Up @@ -1462,7 +1461,6 @@ def GetDataCacheFunctions(self):


def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):
x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once
x_PowX2 = inDataCacheDictionary['PowX_2.0'] # only need to perform this dictionary look-up once
x_PowX4 = inDataCacheDictionary['PowX_4.0'] # only need to perform this dictionary look-up once
x_PowX6 = inDataCacheDictionary['PowX_6.0'] # only need to perform this dictionary look-up once
Expand Down
4 changes: 2 additions & 2 deletions Models_2D/Peak.py
Original file line number Diff line number Diff line change
Expand Up @@ -1397,14 +1397,14 @@ def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):
b = inCoeffs[1]

try:
temp = 1.0 / (1.0 + numpy.square(x_in-a))
temp = 1.0 / (1.0 + numpy.power(x_in-a, b))
return self.extendedVersionHandler.GetAdditionalModelPredictions(temp, inCoeffs, inDataCacheDictionary, self)
except:
return numpy.ones(len(inDataCacheDictionary['DependentData'])) * 1.0E300


def SpecificCodeCPP(self):
s = "\ttemp = 1.0 / (1.0 + pow(x_in-a, 2.0));\n"
s = "\ttemp = 1.0 / (1.0 + pow(x_in-a, b));\n"
return s


Expand Down
5 changes: 0 additions & 5 deletions Models_2D/Spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
if os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..') not in sys.path:
sys.path.append(os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..'))

import numpy
try:
import scipy.interpolate
except:
pass
import pyeq3


Expand Down
2 changes: 1 addition & 1 deletion Models_2D/UserDefinedFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import numpy # implicitly required by compiling the userFunctionCodeObject in the method EvaluateCachedData() below
numpy.seterr(all= 'ignore')

import io, parser, types
import io, parser

import pyeq3.Model_2D_BaseClass

Expand Down
1 change: 0 additions & 1 deletion Models_3D/BioScience.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ def GetDataCacheFunctions(self):


def CalculateModelPredictions(self, inCoeffs, inDataCacheDictionary):
x_in = inDataCacheDictionary['X'] # only need to perform this dictionary look-up once
y_in = inDataCacheDictionary['Y'] # only need to perform this dictionary look-up once
x_plus_y = inDataCacheDictionary['XPLUSY'] # only need to perform this dictionary look-up once

Expand Down
5 changes: 0 additions & 5 deletions Models_3D/Spline.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
if os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..') not in sys.path:
sys.path.append(os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '..'))

import numpy
try:
import scipy.interpolate
except:
pass
import pyeq3


Expand Down
2 changes: 1 addition & 1 deletion Models_3D/UserDefinedFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import numpy # implicitly required by compiling the userFunctionCodeObject in the method EvaluateCachedData() below
numpy.seterr(all= 'ignore')

import io, parser, types
import io, parser



Expand Down
3 changes: 1 addition & 2 deletions Services/SolverService.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
pass
numpy.seterr(all= 'ignore')

import pyeq3
from . import diffev

class custom_prng_for_diffev(numpy.random.mtrand.RandomState):
Expand Down Expand Up @@ -171,7 +170,7 @@ def SolveUsingSelectedAlgorithm(self, inModel, inAlgorithmName):

def SolveUsingODR(self, inModel):

data = inModel.dataCache.FindOrCreateAllDataCache(inModel)
inModel.dataCache.FindOrCreateAllDataCache(inModel)
modelObject = scipy.odr.odrpack.Model(inModel.WrapperForODR)
if len(inModel.dataCache.allDataCacheDictionary['Weights']):
dataObject = scipy.odr.odrpack.Data(inModel.dataCache.allDataCacheDictionary['IndependentData'], inModel.dataCache.allDataCacheDictionary['DependentData'], inModel.dataCache.allDataCacheDictionary['Weights'])
Expand Down

0 comments on commit c76b12e

Please sign in to comment.