<s> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> from __future__ import absolute_import <EOL> import pyeq2 <EOL> from . import IExtendedVersionHandler <EOL> import numpy <EOL> numpy . seterr ( all = '<STR_LIT:ignore>' ) <EOL> class ExtendedVersionHandler_ExponentialGrowthAndOffset ( IExtendedVersionHandler . IExtendedVersionHandler ) : <EOL> def AssembleDisplayHTML ( self , inModel ) : <EOL> x_or_xy = '<STR_LIT>' <EOL> if inModel . GetDimensionality ( ) == <NUM_LIT:2> : <EOL> x_or_xy = '<STR_LIT:x>' <EOL> if inModel . baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions : <EOL> return inModel . _HTML + '<STR_LIT>' + inModel . _leftSideHTML + '<STR_LIT>' + inModel . _leftSideHTML + '<STR_LIT>' + x_or_xy + '<STR_LIT>' <EOL> else : <EOL> try : <EOL> cd = inModel . GetCoefficientDesignators ( ) <EOL> return inModel . _HTML + '<STR_LIT>' + inModel . _leftSideHTML + '<STR_LIT>' + inModel . _leftSideHTML + '<STR_LIT>' + cd [ - <NUM_LIT:2> ] + '<STR_LIT>' + x_or_xy + '<STR_LIT>' <EOL> except : <EOL> return inModel . _HTML + '<STR_LIT>' + inModel . _leftSideHTML + '<STR_LIT>' + inModel . _leftSideHTML + '<STR_LIT>' + x_or_xy + '<STR_LIT>' <EOL> def AssembleDisplayName ( self , inModel ) : <EOL> return inModel . _baseName + '<STR_LIT>' <EOL> def AssembleSourceCodeName ( self , inModel ) : <EOL> return inModel . __module__ . split ( '<STR_LIT:.>' ) [ - <NUM_LIT:1> ] + '<STR_LIT:_>' + inModel . __class__ . __name__ + "<STR_LIT>" <EOL> def AssembleCoefficientDesignators ( self , inModel ) : <EOL> if inModel . baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions : <EOL> return inModel . _coefficientDesignators + [ '<STR_LIT>' ] <EOL> else : <EOL> return inModel . _coefficientDesignators + [ inModel . listOfAdditionalCoefficientDesignators [ len ( inModel . _coefficientDesignators ) ] , '<STR_LIT>' ] <EOL> def AppendAdditionalCoefficientBounds ( self , inModel ) : <EOL> if inModel . baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions : <EOL> if inModel . upperCoefficientBounds != [ ] : <EOL> inModel . upperCoefficientBounds . append ( None ) <EOL> if inModel . lowerCoefficientBounds != [ ] : <EOL> inModel . lowerCoefficientBounds . append ( None ) <EOL> else : <EOL> if inModel . upperCoefficientBounds != [ ] : <EOL> inModel . upperCoefficientBounds . append ( None ) <EOL> inModel . upperCoefficientBounds . append ( None ) <EOL> if inModel . lowerCoefficientBounds != [ ] : <EOL> inModel . lowerCoefficientBounds . append ( None ) <EOL> inModel . lowerCoefficientBounds . append ( None ) <EOL> def AssembleOutputSourceCodeCPP ( self , inModel ) : <EOL> x_or_xy = '<STR_LIT>' <EOL> if inModel . GetDimensionality ( ) == <NUM_LIT:2> : <EOL> x_or_xy = '<STR_LIT>' <EOL> if inModel . baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions : <EOL> return inModel . SpecificCodeCPP ( ) + "<STR_LIT>" + x_or_xy + "<STR_LIT>" <EOL> else : <EOL> cd = inModel . GetCoefficientDesignators ( ) <EOL> return inModel . SpecificCodeCPP ( ) + "<STR_LIT>" + cd [ - <NUM_LIT:2> ] + '<STR_LIT>' + x_or_xy + "<STR_LIT>" <EOL> def GetAdditionalDataCacheFunctions ( self , inModel , inDataCacheFunctions ) : <EOL> foundX = False <EOL> foundXY = False <EOL> for i in inDataCacheFunctions : <EOL> if i [ <NUM_LIT:0> ] == '<STR_LIT>' and inModel . GetDimensionality ( ) == <NUM_LIT:2> : <EOL> foundX = True <EOL> if i [ <NUM_LIT:0> ] == '<STR_LIT>' and inModel . GetDimensionality ( ) == <NUM_LIT:3> : <EOL> foundXY = True <EOL> if inModel . GetDimensionality ( ) == <NUM_LIT:2> : <EOL> if not foundX : <EOL> return inDataCacheFunctions + [ [ pyeq2 . DataCache . DataCacheFunctions . ExpX ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ] <EOL> else : <EOL> if not foundXY : <EOL> return inDataCacheFunctions + [ [ pyeq2 . DataCache . DataCacheFunctions . ExpXY ( NameOrValueFlag = <NUM_LIT:1> ) , [ ] ] ] <EOL> return inDataCacheFunctions <EOL> def GetAdditionalModelPredictions ( self , inBaseModelCalculation , inCoeffs , inDataCacheDictionary , inModel ) : <EOL> if inModel . GetDimensionality ( ) == <NUM_LIT:2> : <EOL> if inModel . baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions : <EOL> return self . ConvertInfAndNanToLargeNumber ( inBaseModelCalculation * inDataCacheDictionary [ '<STR_LIT>' ] + inCoeffs [ len ( inCoeffs ) - <NUM_LIT:1> ] ) <EOL> else : <EOL> return self . ConvertInfAndNanToLargeNumber ( inBaseModelCalculation * ( inCoeffs [ len ( inCoeffs ) - <NUM_LIT:2> ] * inDataCacheDictionary [ '<STR_LIT>' ] ) + inCoeffs [ len ( inCoeffs ) - <NUM_LIT:1> ] ) <EOL> else : <EOL> if inModel . baseEquationHasGlobalMultiplierOrDivisor_UsedInExtendedVersions : <EOL> return self . ConvertInfAndNanToLargeNumber ( inBaseModelCalculation * inDataCacheDictionary [ '<STR_LIT>' ] + inCoeffs [ len ( inCoeffs ) - <NUM_LIT:1> ] ) <EOL> else : <EOL> return self . ConvertInfAndNanToLargeNumber ( inBaseModelCalculation * ( inCoeffs [ len ( inCoeffs ) - <NUM_LIT:2> ] * inDataCacheDictionary [ '<STR_LIT>' ] ) + inCoeffs [ len ( inCoeffs ) - <NUM_LIT:1> ] ) </s>
