def test_cause_info(s): mechanism = (0, 1) purview = (0, 2) answer = hamming_emd( s.cause_repertoire(mechanism, purview), s.unconstrained_cause_repertoire(purview)) assert s.cause_info(mechanism, purview) == answer
def test_cause_info(s): mechanism = (0, 1) purview = (0, 2) answer = hamming_emd( s.cause_repertoire(mechanism, purview), s.unconstrained_cause_repertoire(purview), ) assert s.cause_info(mechanism, purview) == answer
def test_emd_validates_distribution_shapes(): a = np.ones((2, 2, 2)) / 8 b = np.ones((3, 3, 3)) / 27 with pytest.raises(ValueError): distance.hamming_emd(a, b)
def test_emd_same_distributions(): a = np.ones((2, 2, 2)) / 8 b = np.ones((2, 2, 2)) / 8 assert distance.hamming_emd(a, b) == 0.0
def test_emd_validates_distribution_shapes(): a = np.ones((2, 2, 2)) / 8 b = np.ones((3, 3, 3)) / 27 with pytest.raises(ValueError): distance.hamming_emd(a, b)
def test_emd_same_distributions(): a = np.ones((2, 2, 2)) / 8 b = np.ones((2, 2, 2)) / 8 assert distance.hamming_emd(a, b) == 0.0
def test_effect_info(s): mechanism = (0, 1) purview = (0, 2) answer = hamming_emd(s.effect_repertoire(mechanism, purview), s.unconstrained_effect_repertoire(purview)) assert s.effect_info(mechanism, purview) == answer