Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player.in_round() does not work with numpy datatypes in otree 5 #98

Open
js-frey opened this issue Jun 10, 2021 · 0 comments
Open

player.in_round() does not work with numpy datatypes in otree 5 #98

js-frey opened this issue Jun 10, 2021 · 0 comments

Comments

@js-frey
Copy link

js-frey commented Jun 10, 2021

in oTree 5 the player.in_round() funktion does not work with numpy interger datatypes.

For istance the following code leads to an error "Failed to create session: No corresponding Player found with round_number=1"

def creating_session(subsession: Subsession):
    for p in subsession.get_players():
        p.in_round(np.int64(1))

I tested the equivalent function in otree 3 and there it works with no issues.

While this is not a big issue since one can always convert to standart python integers, the error message here is not very helpful which makes it hard to debug.

EDIT:
numpy datatypes seem to cause issues in other situations as well. For instance storing numpy integers in an IntegerField does not seem to work as it should

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant