Skip to content

Clarify support for choices as int in HSSM class #932

@cpaniaguam

Description

@cpaniaguam

The docstring says choices can be an int (number of choices), but HSSM.__init__ types it as list[int] | None and it's not clear where the logic for creating the actual list of choices is.

HSSM/src/hssm/hssm.py

Lines 115 to 121 in 3654d2d

choices : optional
When an `int`, the number of choices that the participants can make. If `2`, the
choices are [-1, 1] by default. If anything greater than `2`, the choices are
[0, 1, ..., n_choices - 1] by default. If a `list` is provided, it should be the
list of choices that the participants can make. Defaults to `2`. If any value
other than the choices provided is found in the "response" column of the data,
an error will be raised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions