How to use the permuta.Perm.from_string function in permuta

To help you get started, we’ve selected a few permuta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PermutaTriangle / Permuta / tests / patterns / test_perm.py View on Github external
def test_from_string():
    assert Perm.from_string("203451") == Perm((2, 0, 3, 4, 5, 1))
    assert Perm.from_string("40132") == Perm((4, 0, 1, 3, 2))
    assert Perm.from_string("0") == Perm((0,))

    for _ in range(100):
        perm = Perm.random(random.randint(0, 10))
        assert perm == Perm.from_string("".join(map(str, perm)))
github PermutaTriangle / Permuta / tests / patterns / test_perm.py View on Github external
def test_from_string():
    assert Perm.from_string("203451") == Perm((2, 0, 3, 4, 5, 1))
    assert Perm.from_string("40132") == Perm((4, 0, 1, 3, 2))
    assert Perm.from_string("0") == Perm((0,))

    for _ in range(100):
        perm = Perm.random(random.randint(0, 10))
        assert perm == Perm.from_string("".join(map(str, perm)))
github PermutaTriangle / Permuta / tests / patterns / test_perm.py View on Github external
def test_from_string():
    assert Perm.from_string("203451") == Perm((2, 0, 3, 4, 5, 1))
    assert Perm.from_string("40132") == Perm((4, 0, 1, 3, 2))
    assert Perm.from_string("0") == Perm((0,))

    for _ in range(100):
        perm = Perm.random(random.randint(0, 10))
        assert perm == Perm.from_string("".join(map(str, perm)))
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_applies_to_a_symmetry(self):
        assert Ru2143CoreStrategy([cu, p2143]).applies()
        assert Ru2143CoreStrategy(
            [
                Perm.from_string("0231"),
                Perm.from_string("1032"),
                Perm.from_string("03124"),
            ]
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_applies_to_a_symmetry(self):
        assert Rd2134CoreStrategy([cd, p2134]).applies()
        assert Rd2134CoreStrategy(
            [
                Perm.from_string("0132"),
                Perm.from_string("1302"),
                Perm.from_string("32014"),
            ]
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_applies_to_a_symmetry(self):
        assert Ru2143CoreStrategy([cu, p2143]).applies()
        assert Ru2143CoreStrategy(
            [
                Perm.from_string("0231"),
                Perm.from_string("1032"),
                Perm.from_string("03124"),
            ]
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_applies_to_a_symmetry(self):
        assert Rd2134CoreStrategy([cd, p2134]).applies()
        assert Rd2134CoreStrategy(
            [
                Perm.from_string("0132"),
                Perm.from_string("1302"),
                Perm.from_string("32014"),
            ]
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_applies_to_a_symmetry(self):
        assert Ru2143CoreStrategy([cu, p2143]).applies()
        assert Ru2143CoreStrategy(
            [
                Perm.from_string("0231"),
                Perm.from_string("1032"),
                Perm.from_string("03124"),
            ]
github PermutaTriangle / Permuta / tests / enumeration_strategies / test_core_strategies.py View on Github external
def test_applies_to_a_symmetry(self):
        assert Rd2134CoreStrategy([cd, p2134]).applies()
        assert Rd2134CoreStrategy(
            [
                Perm.from_string("0132"),
                Perm.from_string("1302"),
                Perm.from_string("32014"),
            ]