Exemplo n.º 1
0
def test_invalid_type_channel_presence():
    """Test an invalid input typing."""
    with pytest.raises(TypeError):
        mob.channel_presence('invalid type input')
Exemplo n.º 2
0
def test_channel_presence_array_list():
    """Test channel presence with a list of arrays."""
    chan_presence = mob.channel_presence(chmap_list)
    assert np.all(
        chan_presence == np.array([[0., 0.8, 0.2, 0.], [0., 0.6, 0.4, 0.],
                                   [0., 0.4, 0.6, 0.], [0., 0.2, 0.8, 0.]]))
Exemplo n.º 3
0
def test_invalid_list_channel_presence():
    """Test an invalid list."""
    with pytest.raises(ValueError):
        mob.channel_presence(['in', 'valid', 'list'])
Exemplo n.º 4
0
def test_channel_presence_xarray():
    """Test channel presence with an xarray."""
    chan_presence = mob.channel_presence(chmap_xr)
    assert np.all(
        chan_presence == np.array([[0., 0.8, 0.2, 0.], [0., 0.6, 0.4, 0.],
                                   [0., 0.4, 0.6, 0.], [0., 0.2, 0.8, 0.]]))