<commit_before>#!/usr/bin/env python
import spatial_efd
import os
import os.path as path
import numpy as np
import numpy.testing as ntest
import shapefile as shp
from unittest import TestCase
import matplotlib
matplotlib.use('Agg')


class TestEFD(TestCase):
    def test_area(self):
        a = spatial_efd.ContourArea([0, 10, 10, 0], [0, 0, 10, 10])
        self.assertEqual(a, 100)

    def test_centroid(self):
        c = spatial_efd.ContourCentroid([0, 10, 10, 0], [0, 0, 10, 10])
        self.assertTupleEqual(c, (5, 5))

    def test_centroid_clockwise(self):
        x, y = [0, 10, 10, 0], [0, 0, 10, 10]
        x = x[::-1]
        y = y[::-1]
        c = spatial_efd.ContourCentroid(x, y)
        self.assertTupleEqual(c, (5, 5))

    def test_area_clockwise(self):
        x, y = [0, 10, 10, 0], [0, 0, 10, 10]
        x = x[::-1]
        y = y[::-1]
        a = spatial_efd.ContourArea(x, y)
        self.assertEqual(a, 100)

    def test_nyquist(self):
        n = spatial_efd.Nyquist(np.array([[0, 0], [10, 0], [10, 10], [10, 0]]))
        self.assertEqual(n, 2)

    def test_plot_init(self):
        a = spatial_efd.InitPlot()
        self.assertTrue(isinstance(a, matplotlib.axes.Axes))

    def test_rotate_contour(self):
        x, y = spatial_efd.RotateContour([0, 10, 10, 0], [0, 0, 10, 10], 30.,
                                         (5, 5))<commit_msg>fixing new tests to cover the new logic<commit_after>#!/usr/bin/env python
import spatial_efd
import os
import os.path as path
import numpy as np
import numpy.testing as ntest
import shapefile as shp
from unittest import TestCase
import matplotlib
matplotlib.use('Agg')


class TestEFD(TestCase):
    def test_area(self):
        a = spatial_efd.ContourArea([0, 10, 10, 0], [0, 0, 10, 10])
        self.assertEqual(a, 100)

    def test_centroid(self):
        c = spatial_efd.ContourCentroid([0, 10, 10, 0], [0, 0, 10, 10])
        self.assertTupleEqual(c, (5, 5))

    def test_centroid_clockwise(self):
        c = spatial_efd.ContourCentroid([0, 10, 10, 0, 0], [0, 0, 10, 10, 0])
        self.assertTupleEqual(c, (5, 5))

    def test_area_clockwise(self):
        a = spatial_efd.ContourArea([0, 10, 10, 0, 0], [0, 0, 10, 10, 0])
        self.assertEqual(a, 100)

    def test_nyquist(self):
        n = spatial_efd.Nyquist(np.array([[0, 0], [10, 0], [10, 10], [10, 0]]))
        self.assertEqual(n, 2)

    def test_plot_init(self):
        a = spatial_efd.InitPlot()
        self.assertTrue(isinstance(a, matplotlib.axes.Axes))

    def test_rotate_contour(self):
        x, y = spatial_efd.RotateContour([0, 10, 10, 0], [0, 0, 10, 10], 30.,
                                         (5, 5))
{'fraction_non_alphanumeric': 0.14947683109118087, 'fraction_numerical': 0.06801195814648729, 'mean_word_length': 2.5981182795698925, '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': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '741423', 'n_tokens_mistral': 1159, 'n_tokens_neox': 984, 'n_words': 264}