예제 #1
0
def test_eval_start_slope():
    """Test evaluating the slope shape in start/slope mode.

    """
    shape = SlopeShape(mode='Start/Slope', def1='{a}', def2='-0.5', index=1)
    root_vars = {'a': 0, '1_duration': 1}
    missing = set()
    errors = {}

    assert shape.eval_entries({}, root_vars, missing, errors)
    assert missing == set()
    assert errors == {}
    assert_array_equal(shape.compute(np.ones(11), 'mus'),
                       np.linspace(0.0, -0.5, 11))
예제 #2
0
def test_eval_start_stop():
    """Test evaluating the slope shape in start/stop mode.

    """
    shape = SlopeShape(mode='Start/Stop', def1='0.5', def2='{a}')
    root_vars = {'a': -1.0}
    missing = set()
    errors = {}

    assert shape.eval_entries({}, root_vars, missing, errors)
    assert missing == set()
    assert errors == {}
    assert_array_equal(shape.compute(np.linspace(0, 1, 11), 'mus'),
                       np.linspace(0.5, -1.0, 11))
예제 #3
0
def test_eval_slope_stop():
    """Test evaluating the entries of an active modulation when some vars
    are missing.
    Issue on amplitude.

    """
    """Test evaluating the slope shape in start/slope mode.

    """
    shape = SlopeShape(mode='Slope/Stop', def1='{a}', def2='-1', index=1)
    root_vars = {'a': -0.5, '1_duration': 1}
    missing = set()
    errors = {}

    assert shape.eval_entries({}, root_vars, missing, errors)
    assert missing == set()
    assert errors == {}
    assert_array_equal(shape.compute(np.ones(11), 'mus'),
                       np.linspace(-0.5, -1.0, 11))