<commit_before>import pytest
import numpy

from ...ids2vecs import WindowEncode
from ...optimizers import SGD


class MyWindowEncode(WindowEncode):
    device = 'cpu'

    def add_param(self, id_, shape):
        pass


@pytest.fixture
def model():
    model = MyWindowEncode(device='cpu', nr_in=10, nr_out=3, vectors={})
    assert model.nr_out == 3
    return model


def test_init():
    model = MyWindowEncode(device='cpu', nr_out=10, nr_in=2, vectors={})
    assert model.nr_out == 10
    assert model.W.shape == (10, 3, 5, 2)


def test_get_ids(model):
    x = [[1, 10], [20, 20]]
    ids = model._get_positions(x)
    assert ids == {1: [(0, 0)], 10: [(0, 1)], 20: [(1, 0), (1, 1)]}


def test_dot_ids(model):
    x = [[1, 10], [20, 20]]
    ids = model._get_positions(x)
    assert ids == {1: [(0, 0)], 10: [(0, 1)], 20: [(1, 0), (1, 1)]}
    model._dot_ids(ids, [2, 2])<commit_msg>Skip tests for window encode<commit_after>import pytest
import numpy

from ...ids2vecs import WindowEncode
from ...optimizers import SGD


class MyWindowEncode(WindowEncode):
    device = 'cpu'

    def add_param(self, id_, shape):
        pass


@pytest.fixture
def model():
    model = MyWindowEncode(device='cpu', nr_in=10, nr_out=3, vectors={})
    assert model.nr_out == 3
    return model

@pytest.mark.skip
def test_init():
    model = MyWindowEncode(device='cpu', nr_out=10, nr_in=2, vectors={})
    assert model.nr_out == 10
    assert model.W.shape == (10, 3, 5, 2)


@pytest.mark.skip
def test_get_ids(model):
    x = [[1, 10], [20, 20]]
    ids = model._get_positions(x)
    assert ids == {1: [(0, 0)], 10: [(0, 1)], 20: [(1, 0), (1, 1)]}


@pytest.mark.skip
def test_dot_ids(model):
    x = [[1, 10], [20, 20]]
    ids = model._get_positions(x)
    assert ids == {1: [(0, 0)], 10: [(0, 1)], 20: [(1, 0), (1, 1)]}
    model._dot_ids(ids, [2, 2])
{'fraction_non_alphanumeric': 0.18689057421451788, 'fraction_numerical': 0.06175514626218852, 'mean_word_length': 3.4292565947242206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5386896', 'n_tokens_mistral': 808, 'n_tokens_neox': 707, 'n_words': 200}