diff --git a/CHANGELOG.md b/CHANGELOG.md index 8577c15..8f2fafe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ FEATURE: - `symmetria.Permutation`: add `lexicographic_rank` method - `symmetria.CycleDecomposition`: add `lexicographic_rank` method +FIX: +- `symmetria.Permutation`: fix small typos in class methods + ## \[0.3.0\] - 2024-07-15 FEATURE: diff --git a/symmetria/elements/permutation.py b/symmetria/elements/permutation.py index 96c11c9..bc6061b 100644 --- a/symmetria/elements/permutation.py +++ b/symmetria/elements/permutation.py @@ -638,7 +638,7 @@ def from_cycle(cls, cycle: "Cycle") -> "Permutation": image.append(cycle[(idx + 1) % cycle_length]) else: image.append(element) - return Permutation(*image) + return cls(*image) @classmethod def from_cycle_decomposition(cls, cycle_decomposition: "CycleDecomposition") -> "Permutation": @@ -660,7 +660,7 @@ def from_cycle_decomposition(cls, cycle_decomposition: "CycleDecomposition") -> >>> Permutation.from_cycle_decomposition(CycleDecomposition(Cycle(4, 3), Cycle(1, 2))) Permutation(2, 1, 4, 3) """ - return Permutation.from_dict(p=cycle_decomposition.map) + return cls.from_dict(p=cycle_decomposition.map) @classmethod def from_dict(cls, p: Dict[int, int]) -> "Permutation": @@ -681,7 +681,7 @@ def from_dict(cls, p: Dict[int, int]) -> "Permutation": >>> Permutation.from_dict({1: 5, 2: 3, 3: 1, 4: 2, 5:4}) Permutation(5, 3, 1, 2, 4) """ - return Permutation(*[p[idx] for idx in range(1, len(p) + 1)]) + return cls(*[p[idx] for idx in range(1, len(p) + 1)]) @property def image(self) -> Tuple[int]: