Exemple #1
0
    def test_scales(self):
        pim = PersImage()

        wf = pim.weighting(np.array([[0, 1], [1, 2], [3, 4]]))

        assert wf([1, 0]) == 0
        assert wf([1, 4]) == 1
        assert wf([1, 2]) == .5
Exemple #2
0
    def test_zero_on_xaxis(self):
        pim = PersImage()

        wf = pim.weighting()

        assert wf([1, 0]) == 0
        assert wf([100, 0]) == 0
        assert wf([99, 1.4]) == 1.4