def test_kwargs(self):
        # using kwarg 'r' correctly
        self.assertEqual(self.hv2d_1.least_contributor(r=self.r), 1)
        # using kwarg 'r' and 'algorithm' correctly
        self.assertEqual(
            self.hv2d_1.least_contributor(r=self.r,
                                          algorithm=hv_algorithm.hv2d()), 1)

        # bad kwarg for reference point
        self.assertRaises(TypeError,
                          self.hv2d_0.least_contributor,
                          refpoint=[4, 4])
        self.assertRaises(
            TypeError,
            self.hv2d_0.least_contributor,
            r=[4, 4],
            foo="Something extra")  # we do not accept random kwargs
        # we do not accept random kwargs (as above but with ref point as arg)
        self.assertRaises(TypeError,
                          self.hv2d_0.least_contributor, [4, 4],
                          foo="Something extra")
        self.assertRaises(
            TypeError,
            self.hv2d_0.least_contributor, [4, 4],
            hv_algorithm.hv2d(),
            foo="Something extra")  # we do not accept random kwargs
 def test_kwargs_hv_algo(self):
     # using kwargs correctly
     self.assertEqual(
         self.hv2d.compute(r=[4, 4], algorithm=hv_algorithm.hv2d()), 6)
     # using kwargs in reversed order
     self.assertEqual(
         self.hv2d.compute(algorithm=hv_algorithm.hv2d(), r=[4, 4]), 6)
     # arg + kwarg
     self.assertEqual(
         self.hv2d.compute([4, 4], algorithm=hv_algorithm.hv2d()), 6)
     self.assertEqual(
         self.hv2d.compute([4, 4], hv_algorithm.hv2d()), 6)  # arg + arg
     # should use nadir point
     self.assertRaises(
         TypeError, self.hv2d.compute, algorithm=hv_algorithm.hv2d())
 def test_kwargs_hv_algo(self):
     # using kwargs correctly
     self.assertEqual(
         self.hv2d.compute(r=[4, 4], algorithm=hv_algorithm.hv2d()), 6)
     # using kwargs in reversed order
     self.assertEqual(
         self.hv2d.compute(algorithm=hv_algorithm.hv2d(), r=[4, 4]), 6)
     # arg + kwarg
     self.assertEqual(
         self.hv2d.compute([4, 4], algorithm=hv_algorithm.hv2d()), 6)
     self.assertEqual(self.hv2d.compute([4, 4], hv_algorithm.hv2d()),
                      6)  # arg + arg
     # should use nadir point
     self.assertRaises(TypeError,
                       self.hv2d.compute,
                       algorithm=hv_algorithm.hv2d())
    def test_kwargs(self):
        self.assertRaises(TypeError, self.hv2d.exclusive, 0)  # no refpoint
        # no refpoint
        self.assertRaises(TypeError, self.hv2d.exclusive, p_idx=0)
        self.assertRaises(
            TypeError,
            self.hv2d.exclusive,
            p_idx=0,
            hv_algorithm=hv_algorithm.wfg())  # no refpoint
        self.assertEqual(self.hv2d.exclusive(0, self.r), 1)  # using arg
        # using kwarg 'r' correctly
        self.assertEqual(self.hv2d.exclusive(0, r=self.r), 1)
        # using kwarg 'r' correctly
        self.assertEqual(self.hv2d.exclusive(p_idx=0, r=self.r), 1)

        self.assertRaises(
            TypeError,
            self.hv2d.exclusive,
            p_idx=0,
            algorithm=hv_algorithm.hv2d())  # no refpoint
        self.assertEqual(
            self.hv2d.exclusive(0, self.r, hv_algorithm.hv2d()), 1)  # all args
        self.assertEqual(
            self.hv2d.exclusive(
                0,
                self.r,
                algorithm=hv_algorithm.hv2d()),
            1)  # last kwarg
        self.assertEqual(self.hv2d.exclusive(
            p_idx=0, r=self.r, algorithm=hv_algorithm.hv2d()), 1)  # all kwargs
        self.assertEqual(
            self.hv2d.exclusive(
                algorithm=hv_algorithm.hv2d(),
                r=self.r,
                p_idx=0),
            1)  # all kwargs in reverse

        # bad kwarg for reference point
        self.assertRaises(TypeError, self.hv2d.exclusive, 0, refpoint=[4, 4])
        # we do not accept random kwargs
        self.assertRaises(
            TypeError, self.hv2d.exclusive, 0, r=[4, 4], foo="Something extra")
        # we do not accept random kwargs (as above but with ref point as arg)
        self.assertRaises(
            TypeError, self.hv2d.exclusive, 0, [4, 4], foo="Something extra")
        self.assertRaises(
            TypeError, self.hv2d.exclusive, 0, [4, 4], hv_algorithm.hv2d(),
            foo="Something extra")   # we do not accept random kwargs
        self.assertRaises(
            TypeError,
            self.hv2d.exclusive,
            p_idx=0,
            r=self.r,
            algorithm=hv_algorithm.hv2d(),
            foo="Something extra")
        self.assertRaises(TypeError, self.hv2d.exclusive,
                          r=self.r, algorithm=hv_algorithm.hv2d())  # no p_idx
    def test_kwargs(self):
        # using kwarg 'r' correctly
        self.assertEqual(self.hv2d.compute(r=[3.5, 3.5]), 3.25)
        # using kwargs 'r', 'algorithm' correctly
        self.assertEqual(
            self.hv2d.compute(r=[3.5, 3.5], algorithm=hv_algorithm.hv2d()),
            3.25)

        # bad kwarg for reference point
        self.assertRaises(TypeError, self.hv2d.compute, refpoint=[4, 4])
        # we do not accept random kwargs
        self.assertRaises(
            TypeError, self.hv2d.compute, r=[4, 4], foo="Something extra")
        # we do not accept random kwargs (as above but with ref point as arg)
        self.assertRaises(
            TypeError, self.hv2d.compute, [4, 4], foo="Something extra")
        self.assertRaises(
            TypeError, self.hv2d.compute, [4, 4], hv_algorithm.hv2d(),
            foo="Something extra")   # we do not accept random kwargs
    def test_kwargs(self):
        # using kwarg 'r' correctly
        self.assertEqual(self.hv2d.compute(r=[3.5, 3.5]), 3.25)
        # using kwargs 'r', 'algorithm' correctly
        self.assertEqual(
            self.hv2d.compute(r=[3.5, 3.5], algorithm=hv_algorithm.hv2d()),
            3.25)

        # bad kwarg for reference point
        self.assertRaises(TypeError, self.hv2d.compute, refpoint=[4, 4])
        # we do not accept random kwargs
        self.assertRaises(TypeError,
                          self.hv2d.compute,
                          r=[4, 4],
                          foo="Something extra")
        # we do not accept random kwargs (as above but with ref point as arg)
        self.assertRaises(TypeError,
                          self.hv2d.compute, [4, 4],
                          foo="Something extra")
        self.assertRaises(
            TypeError,
            self.hv2d.compute, [4, 4],
            hv_algorithm.hv2d(),
            foo="Something extra")  # we do not accept random kwargs
    def test_kwargs(self):
        # using kwarg 'r' correctly
        self.assertEqual(self.hv2d_1.least_contributor(r=self.r), 1)
        # using kwarg 'r' and 'algorithm' correctly
        self.assertEqual(
            self.hv2d_1.least_contributor(
                r=self.r,
                algorithm=hv_algorithm.hv2d()),
            1)

        # bad kwarg for reference point
        self.assertRaises(
            TypeError, self.hv2d_0.least_contributor, refpoint=[4, 4])
        self.assertRaises(
            TypeError, self.hv2d_0.least_contributor, r=[
                4, 4], foo="Something extra")  # we do not accept random kwargs
        # we do not accept random kwargs (as above but with ref point as arg)
        self.assertRaises(
            TypeError, self.hv2d_0.least_contributor, [
                4, 4], foo="Something extra")
        self.assertRaises(
            TypeError, self.hv2d_0.least_contributor, [4, 4], hv_algorithm.
            hv2d(), foo="Something extra")   # we do not accept random kwargs
    def test_kwargs(self):
        self.assertRaises(TypeError, self.hv2d.exclusive, 0)  # no refpoint
        # no refpoint
        self.assertRaises(TypeError, self.hv2d.exclusive, p_idx=0)
        self.assertRaises(TypeError,
                          self.hv2d.exclusive,
                          p_idx=0,
                          hv_algorithm=hv_algorithm.wfg())  # no refpoint
        self.assertEqual(self.hv2d.exclusive(0, self.r), 1)  # using arg
        # using kwarg 'r' correctly
        self.assertEqual(self.hv2d.exclusive(0, r=self.r), 1)
        # using kwarg 'r' correctly
        self.assertEqual(self.hv2d.exclusive(p_idx=0, r=self.r), 1)

        self.assertRaises(TypeError,
                          self.hv2d.exclusive,
                          p_idx=0,
                          algorithm=hv_algorithm.hv2d())  # no refpoint
        self.assertEqual(self.hv2d.exclusive(0, self.r, hv_algorithm.hv2d()),
                         1)  # all args
        self.assertEqual(
            self.hv2d.exclusive(0, self.r, algorithm=hv_algorithm.hv2d()),
            1)  # last kwarg
        self.assertEqual(
            self.hv2d.exclusive(p_idx=0,
                                r=self.r,
                                algorithm=hv_algorithm.hv2d()),
            1)  # all kwargs
        self.assertEqual(
            self.hv2d.exclusive(algorithm=hv_algorithm.hv2d(),
                                r=self.r,
                                p_idx=0), 1)  # all kwargs in reverse

        # bad kwarg for reference point
        self.assertRaises(TypeError, self.hv2d.exclusive, 0, refpoint=[4, 4])
        # we do not accept random kwargs
        self.assertRaises(TypeError,
                          self.hv2d.exclusive,
                          0,
                          r=[4, 4],
                          foo="Something extra")
        # we do not accept random kwargs (as above but with ref point as arg)
        self.assertRaises(TypeError,
                          self.hv2d.exclusive,
                          0, [4, 4],
                          foo="Something extra")
        self.assertRaises(
            TypeError,
            self.hv2d.exclusive,
            0, [4, 4],
            hv_algorithm.hv2d(),
            foo="Something extra")  # we do not accept random kwargs
        self.assertRaises(TypeError,
                          self.hv2d.exclusive,
                          p_idx=0,
                          r=self.r,
                          algorithm=hv_algorithm.hv2d(),
                          foo="Something extra")
        self.assertRaises(TypeError,
                          self.hv2d.exclusive,
                          r=self.r,
                          algorithm=hv_algorithm.hv2d())  # no p_idx