sweetpea.core.tests module¶
This module provides tests for SweetPea’s Core framework.
- sweetpea.core.tests.sequence(xss)¶
- Parameters
xss (List[List[sweetpea.core.tests.T]]) –
- Return type
List[List[sweetpea.core.tests.T]]
- sweetpea.core.tests.compute_soln_full_adder(incoming, c_index, s_index)¶
- sweetpea.core.tests.ripple_carry_dimacs(num_digits)¶
- sweetpea.core.tests.pop_count_dimacs(num_digits)¶
- sweetpea.core.tests.permute_complements(xs, to_position=None, complement_func=<built-in function invert>)¶
Given a list of elements, computes a list of each possible permutation of that list with complements. That is, given a list like:
[1, 2, 3]
permute_complements will return:
- [[1, 2, 3], [-1, 2, 3], [1, -2, 3], [-1, -2, 3],
[1, 2, -3], [-1, 2, -3], [1, -2, -3], [-1, -2, -3]]
- Parameters
xs (List[sweetpea.core.tests.T]) –
to_position (Optional[int]) –
complement_func (Callable[[sweetpea.core.tests.T], sweetpea.core.tests.T]) –
- Return type
List[List[sweetpea.core.tests.T]]
- sweetpea.core.tests.assert_k_of_n_dimacs(num_digits, k)¶
- sweetpea.core.tests.assert_all_k_of_n_dimacs(num_digits)¶
- sweetpea.core.tests.pop_count_k_less_than_n_dimacs(num_digits, k)¶