<s> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> from __future__ import absolute_import <EOL> import sys , os , unittest , string <EOL> if - <NUM_LIT:1> != sys . path [ <NUM_LIT:0> ] . find ( '<STR_LIT>' ) : raise Exception ( '<STR_LIT>' ) <EOL> if os . path . join ( sys . path [ <NUM_LIT:0> ] [ : sys . path [ <NUM_LIT:0> ] . rfind ( os . sep ) ] , '<STR_LIT:..>' ) not in sys . path : <EOL> sys . path . append ( os . path . join ( sys . path [ <NUM_LIT:0> ] [ : sys . path [ <NUM_LIT:0> ] . rfind ( os . sep ) ] , '<STR_LIT:..>' ) ) <EOL> import pyeq2 <EOL> import DataForUnitTests <EOL> import numpy <EOL> numpy . seterr ( all = '<STR_LIT:ignore>' ) <EOL> class TestExtendedVersionHandlers ( unittest . TestCase ) : <EOL> def test_ExtendedVersion_Exponential_WithOffset_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . Exponential ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:1> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Reciprocal_Exponential_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . Exponential ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:1> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Reciprocal_Exponential_WithOffset_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . Exponential ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:1> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Inverse_Exponential_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . Exponential ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:1> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Inverse_Exponential_WithOffset_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . Exponential ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:1> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Exponential_WithLinearDecay_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . Exponential ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:1> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Exponential_WithLinearDecayAndOffset_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . Exponential ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:1> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Exponential_WithLinearGrowth_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . Exponential ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:1> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Exponential_WithLinearGrowthAndOffset_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . Exponential ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:1> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Asymptotic_Exponential_A_WithExponentialGrowth_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . AsymptoticExponentialA ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:2> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Asymptotic_Exponential_A_WithExponentialGrowthAndOffset_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . AsymptoticExponentialA ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:2> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Asymptotic_Exponential_A_WithExponentialDecay_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . AsymptoticExponentialA ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:2> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> def test_ExtendedVersion_Asymptotic_Exponential_A_WithExponentialDecayAndOffset_2D ( self ) : <EOL> equation = pyeq2 . Models_2D . Exponential . AsymptoticExponentialA ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . extendedVersionHandler . __class__ . __name__ , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayHTML ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetDisplayName ( ) , '<STR_LIT>' ) <EOL> self . assertEqual ( equation . GetCoefficientDesignators ( ) , [ '<STR_LIT:a>' , '<STR_LIT:b>' , '<STR_LIT>' ] ) <EOL> self . assertEqual ( len ( equation . GetDataCacheFunctions ( ) ) , <NUM_LIT:2> ) <EOL> self . assertFalse ( equation . CanLinearSolverBeUsedForSSQABS ( ) ) <EOL> pyeq2 . dataConvertorService ( ) . ConvertAndSortColumnarASCII ( DataForUnitTests . asciiDataInColumns_2D , equation , False ) <EOL> equation . Solve ( ) <EOL> fittingTarget = equation . CalculateAllDataFittingTarget ( equation . solvedCoefficients ) <EOL> self . assertTrue ( fittingTarget <= <NUM_LIT> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
