<commit_before>"""Check ringtophat results against scipy.ndimage.convolve"""<commit_msg>Add first tests. disk and ring masks for simple cases.<commit_after>"""Check ringtophat results against scipy.ndimage.convolve"""
import unittest
from numpy.testing import assert_equal, assert_almost_equal
import numpy as np
import ringtophat

class TestKernels(unittest.TestCase):
    def test_binary_disk(self):
        actual = ringtophat.binary_disk(1)
        desired = np.array([[False, True, False],
                            [ True, True, True],
                            [False, True, False]])
        assert_equal(actual, desired)
    def test_binary_ring(self):
        actual = ringtophat.binary_ring(1, 2)
        desired = np.array([[False, False, True, False, False],
                            [False, True, True, True, False],
                            [ True, True, False, True, True],
                            [False, True, True, True, False],
                            [False, False, True, False, False]])
        assert_equal(actual, desired)

if __name__ == '__main__':
    unittest.main()

{'fraction_non_alphanumeric': 0.10701438848920863, 'fraction_numerical': 0.002697841726618705, 'mean_word_length': 2.3026706231454006, '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': '5853909', 'n_tokens_mistral': 314, 'n_tokens_neox': 308, 'n_words': 86}