예제 #1
0
def test_blank_str_3():
    expected = [
        "Dataset", '----------', 'Parameters', '----------', 'Datapoints: 199',
        'Predicted domain: frequency', 'Range: from 0.000 to 1.000 PHz',
        'Normalized: True', 'Delay value: 100 fs', 'SPP position(s): 0.5 PHz',
        '----------------------------', 'Metadata extracted from file',
        '----------------------------', '{}'
    ]
    x_ = np.linspace(0, 1, 199)

    d = Dataset(x_, x_)
    d.delay = 100
    d.positions = 0.5
    with setting("precision", 3):
        string = d.__str__().split("\n")
    assert string == expected
예제 #2
0
def test_blank_str_2():
    expected = [
        "Dataset", '----------', 'Parameters', '----------', 'Datapoints: 199',
        'Predicted domain: frequency', 'Range: from 1.000 to 199.000 PHz',
        'Normalized: True', 'Delay value: 100 fs',
        'SPP position(s): Not given', '----------------------------',
        'Metadata extracted from file', '----------------------------', '{}'
    ]
    x_ = np.arange(200)
    y_ = np.linspace(0, 1, 199)

    d = Dataset(x_, y_, errors='force')
    d.delay = 100
    with setting("precision", 3):
        string = d.__str__().split("\n")
    assert string == expected