Skip to content

Commit

Permalink
Within group latin squre order fix
Browse files Browse the repository at this point in the history
ahmed-shariff committed Jan 1, 2025
1 parent 8a7994b commit a1531fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions experiment_server/_participant_ordering.py
Original file line number Diff line number Diff line change
@@ -72,8 +72,8 @@ def construct_participant_condition(config: List[Dict], participant_index: int,
raise ExperimentServerConfigurationExcetion(f"Currently {ORDERING_BEHAVIOUR.latin_square} not supported for `within_groups` when the number of elements in all groups are not the same")
else:
_elements_count = elements_in_group.pop()
_latin_square = balanced_latin_square(_elements_count)
_group_order = _latin_square[(participant_index - 1) % _elements_count]
_latin_square = [el for l in balanced_latin_square(_elements_count) for el in [l,] * len(_filtered_order)]
_group_order = _latin_square[(participant_index - 1) % (_elements_count * len(_filtered_order))]

_filtered_order = [[_g[idx] for idx in _group_order] for _g in _filtered_order]

0 comments on commit a1531fb

Please sign in to comment.