Some methods use sets to ensure the uniqueness of items and rely on the order of items of the set. Python's set order is not deterministic across python interpreters, which makes it hard to control, especially during tests as there is no seed for set that can be controlled.
Using dict.fromkeys instead of set achieves the same uniqueness but guaranteeing deterministic ordering of items.
The following methods are affected:
- PairwisePreference._current_candidates
- Optimized._sample_rankings
- Optimized._sample
Some methods use sets to ensure the uniqueness of items and rely on the order of items of the set. Python's
setorder is not deterministic across python interpreters, which makes it hard to control, especially during tests as there is no seed forsetthat can be controlled.Using
dict.fromkeysinstead ofsetachieves the same uniqueness but guaranteeing deterministic ordering of items.The following methods are affected: