Commit f37eff7b authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Fix coding configuration validity checks.

parent e61c9121
Loading
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -114,10 +114,10 @@ class PrrtCodingConfiguration:
        self.k = k
        self.r = n - k

        if self.r != 0:
            if n_cycle is None:
                raise ValueError("n_cycle cannot be None if n == k.")
            elif sum(n_cycle) != (n-k):
        if self.r != 0 and n_cycle is None:
            raise ValueError("n_cycle cannot be None if (n-k) != 0.")

        if sum(n_cycle) != (n-k):
            raise ValueError("The elements in n_cycle must sum up to n-k.")

        self.n_cycle = n_cycle if n_cycle is not None else [0]