Beispiel #1
0
def test_regex_variable_expansion(collection):
    # Should fail because two output values are required following expansion
    with pytest.raises(Exception):
        transform.copy(collection, 'resp', regex_variables='variables')

    transform.copy(collection, 'resp', output_suffix='_copy',
                   regex_variables='variables')
    assert 'respnum_copy' in collection.variables.keys()
    assert 'respcat_copy' in collection.variables.keys()
    assert np.array_equal(collection['respcat'].values.values,
                          collection['respcat_copy'].values.values)
    assert np.array_equal(collection['respnum'].values.values,
                          collection['respnum_copy'].values.values)
Beispiel #2
0
def test_copy(collection):
    transform.copy(collection, 'RT', output='RT_copy')
    assert 'RT_copy' in collection.variables.keys()
    assert np.array_equal(collection['RT'].values.values,
                          collection['RT_copy'].values.values)