Exemple #1
0
def test_fourAxesInfSlope():
    xScreen = [45, 587, 45, 45]
    yScreen = [171, 171, 15, 327]
    xGraph = [0, 14, 0, 0]
    yGraph = [0, 0, 1.5, -1.5]
    xPoints = 55
    yPoints = 96
    title = 'fourAxesInfSlope.dig'
    TDG.createTestCase(np.array([xScreen, xGraph]), np.array([yScreen,
                                                              yGraph]),
                       xPoints, yPoints, 'Linear', 'Linear', title)
    subprocess.call([ENGAUGE_EXECUTABLE, '-exportonly', title])
    engaugeOutput = pd.read_csv(title[:-3] + 'csv')
    parsedData = np.array(parseDigFile(title).iloc[:, :2])[0]
    testData = np.array(engaugeOutput.iloc[:, :2])[0]
    for i in range(len(testData)):
        decimalIndex = str(testData[i]).find('.')
        decimals = len(str(testData[i])) - decimalIndex - 1
        parsedData[i] = np.round(parsedData[i], decimals)
    assert (parsedData == testData).all()
Exemple #2
0
def TestInfiniteSlope():
    xScreen = [45, 587, 45]
    yScreen = [327, 171, 15]
    xGraph = [0, 14, 0]
    yGraph = [-1.5, 0, 1.5]
    xPoints = 55
    yPoints = 96
    title = '.TestInfiniteSlope.dig'
    TDG.createTestCase(np.array([xScreen, xGraph]), np.array([yScreen,
                                                              yGraph]),
                       xPoints, yPoints, 'Linear', 'Linear', title)
    ParseDig.callEngauge(['-exportonly', title], DEBUG_ENABLE)
    engaugeOutput = pd.read_csv(title[:-3] + 'csv')
    parsedData = np.array(parseDigFile(title).iloc[:, :2])[0]
    testData = np.array(engaugeOutput.iloc[:, :2])[0]
    for i in range(len(testData)):
        decimalIndex = str(testData[i]).find('.')
        decimals = len(str(testData[i])) - decimalIndex - 1
        parsedData[i] = np.round(parsedData[i], decimals)
    showResults(inspect.stack()[0][3], testData, parsedData)