Commit f37eff7b authored by Andreas Schmidt's avatar Andreas Schmidt

Fix coding configuration validity checks.

parent e61c9121
Pipeline #3045 passed with stages
in 1 minute and 29 seconds
......@@ -114,11 +114,11 @@ 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):
raise ValueError("The elements in n_cycle must sum up to 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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment