<commit_before>import unittest
import pysal
from pysal.spatial_dynamics import interaction
import numpy as np


class SpaceTimeEvents_Tester(unittest.TestCase):
    def setUp(self):
        self.path = pysal.examples.get_path("burkitt")

    def test_SpaceTimeEvents(self):
        events = interaction.SpaceTimeEvents(self.path, 'T')
        self.assertEquals(events.n, 188)
        self.assertEquals(list(events.space[0]), [300., 302.])
        self.assertEquals(list(events.t[0]), [413])


class Knox_Tester(unittest.TestCase):
    def setUp(self):
        path = pysal.examples.get_path("burkitt")
        self.events = interaction.SpaceTimeEvents(path, 'T')

    def test_knox(self):
        result = interaction.knox(
            self.events, delta=20, tau=5, permutations=1)
        self.assertEquals(result['stat'], 13.0)


class Mantel_Tester(unittest.TestCase):
    def setUp(self):
        path = pysal.examples.get_path("burkitt")
        self.events = interaction.SpaceTimeEvents(path, 'T')

    def test_mantel(self):
        result = interaction.mantel(self.events, 1, scon=0.0,
                                    spow=1.0, tcon=0.0, tpow=1.0)
        self.assertAlmostEquals(result['stat'], 0.014154, 6)


class Jacquez_Tester(unittest.TestCase):
    def setUp(self):
        path = pysal.examples.get_path("burkitt")
        self.events = interaction.SpaceTimeEvents(path, 'T')

    def test_jacquez(self):
        result = interaction.jacquez(self.events, k=3, permutations=1)
        self.assertEquals(result['stat'], 13)


class ModifiedKnox_Tester(unittest.TestCase):
    def setUp(self):
        path = pysal.examples.get_path("burkitt")
        self.events = interaction.SpaceTimeEvents(path, 'T')

    def test_modified_knox(self):
        result = interaction.modified_knox(
            self.events, delta=20, tau=5, permutations=1)
        self.assertAlmostEquals(result['stat'], 2.810160, 6)


suite = unittest.TestSuite()<commit_msg>- updating tests for new api<commit_after>import unittest
import pysal
from pysal.spatial_dynamics import interaction
import numpy as np


class SpaceTimeEvents_Tester(unittest.TestCase):
    def setUp(self):
        self.path = pysal.examples.get_path("burkitt")

    def test_SpaceTimeEvents(self):
        events = interaction.SpaceTimeEvents(self.path, 'T')
        self.assertEquals(events.n, 188)
        self.assertEquals(list(events.space[0]), [300., 302.])
        self.assertEquals(list(events.t[0]), [413])


class Knox_Tester(unittest.TestCase):
    def setUp(self):
        path = pysal.examples.get_path("burkitt")
        self.events = interaction.SpaceTimeEvents(path, 'T')

    def test_knox(self):
        result = interaction.knox(
            self.events.space,
            self.events.t, delta=20, tau=5, permutations=1)
        self.assertEquals(result['stat'], 13.0)


class Mantel_Tester(unittest.TestCase):
    def setUp(self):
        path = pysal.examples.get_path("burkitt")
        self.events = interaction.SpaceTimeEvents(path, 'T')

    def test_mantel(self):
        result = interaction.mantel(self.events.space,
                self.events.time, 1, scon=0.0, spow=1.0, tcon=0.0, tpow=1.0)
        self.assertAlmostEquals(result['stat'], 0.014154, 6)


class Jacquez_Tester(unittest.TestCase):
    def setUp(self):
        path = pysal.examples.get_path("burkitt")
        self.events = interaction.SpaceTimeEvents(path, 'T')

    def test_jacquez(self):
        result = interaction.jacquez(self.events.space,
                self.events.t, k=3, permutations=1)
        self.assertEquals(result['stat'], 13)


class ModifiedKnox_Tester(unittest.TestCase):
    def setUp(self):
        path = pysal.examples.get_path("burkitt")
        self.events = interaction.SpaceTimeEvents(path, 'T')

    def test_modified_knox(self):
        result = interaction.modified_knox(
            self.events.space,
            self.events.t, delta=20, tau=5, permutations=1)
        self.assertAlmostEquals(result['stat'], 2.810160, 6)


suite = unittest.TestSuite()
{'fraction_non_alphanumeric': 0.1277805239742956, 'fraction_numerical': 0.026693030153237766, 'mean_word_length': 3.176470588235294, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3826343', 'n_tokens_mistral': 1422, 'n_tokens_neox': 1283, 'n_words': 226}