<commit_before>import unittest

import numpy as np

from holoviews import NdOverlay, Element

class CompositeTest(unittest.TestCase):
    "For testing of basic composite element types"

    def setUp(self):
        self.data1 = np.zeros((10, 2))
        self.data2 = np.ones((10, 2))
        self.data3 = np.ones((10, 2)) * 2

        self.view1 = Element(self.data1, label='view1')
        self.view2 = Element(self.data2, label='view2')
        self.view3 = Element(self.data3, label='view3')


class OverlayTest(CompositeTest):

    def test_overlay(self):
        NdOverlay([self.view1, self.view2, self.view3])

    def test_overlay_iter(self):
        views = [self.view1, self.view2, self.view3]
        overlay = NdOverlay(views)
        for el, v in zip(overlay, views):
            self.assertEqual(el, v)

    def test_overlay_labels(self):
        views = [self.view1, self.view2, self.view3]
        overlay = NdOverlay(views)
        self.assertEqual(overlay.labels, [v.label for v in views])


    def test_overlay_add(self):
        overlay = NdOverlay([self.view1])
        overlay.add(self.view2)


    def test_overlay_integer_indexing(self):
        overlay = NdOverlay([self.view1, self.view2, self.view3])
        self.assertEqual(overlay[0], self.view1)
        self.assertEqual(overlay[1], self.view2)
        self.assertEqual(overlay[2], self.view3)
        try:
            overlay[3]
            raise AssertionError("Index should be out of range.")
        except KeyError: pass<commit_msg>Removed test for removed NdOverlay add method<commit_after>import unittest

import numpy as np

from holoviews import NdOverlay, Element

class CompositeTest(unittest.TestCase):
    "For testing of basic composite element types"

    def setUp(self):
        self.data1 = np.zeros((10, 2))
        self.data2 = np.ones((10, 2))
        self.data3 = np.ones((10, 2)) * 2

        self.view1 = Element(self.data1, label='view1')
        self.view2 = Element(self.data2, label='view2')
        self.view3 = Element(self.data3, label='view3')


class OverlayTest(CompositeTest):

    def test_overlay(self):
        NdOverlay([self.view1, self.view2, self.view3])

    def test_overlay_iter(self):
        views = [self.view1, self.view2, self.view3]
        overlay = NdOverlay(views)
        for el, v in zip(overlay, views):
            self.assertEqual(el, v)

    def test_overlay_labels(self):
        views = [self.view1, self.view2, self.view3]
        overlay = NdOverlay(views)
        self.assertEqual(overlay.labels, [v.label for v in views])


    def test_overlay_integer_indexing(self):
        overlay = NdOverlay([self.view1, self.view2, self.view3])
        self.assertEqual(overlay[0], self.view1)
        self.assertEqual(overlay[1], self.view2)
        self.assertEqual(overlay[2], self.view3)
        try:
            overlay[3]
            raise AssertionError("Index should be out of range.")
        except KeyError: pass
{'fraction_non_alphanumeric': 0.11790540540540541, 'fraction_numerical': 0.02837837837837838, 'mean_word_length': 2.7767857142857144, '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': '5589223', 'n_tokens_mistral': 975, 'n_tokens_neox': 942, 'n_words': 214}