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

sortKeys as TRUE rather than FALSE as a default for dlg #3279

Closed
HeJasonL opened this issue Nov 9, 2020 · 1 comment
Closed

sortKeys as TRUE rather than FALSE as a default for dlg #3279

HeJasonL opened this issue Nov 9, 2020 · 1 comment

Comments

@HeJasonL
Copy link

HeJasonL commented Nov 9, 2020

If I am building a task completely in builder view, I am currently unable to sort the 'Experiment Info' in the order that I've placed them in. PsychoPy currently automatically sorts them in alphabetical and/or numeric order, which seemed odd as a default.

I had a look and the code:

"dlg = gui.DlgFromDict(dictionary=expInfo, sort_keys=False, title=expName)"

which has sort_keys=False as a default is right, but doesn't work because sort_keys should now be sortKeys. When run with the code:

"dlg = gui.DlgFromDict(dictionary=expInfo, sortKeys=False, title=expName)"

The Experiment info is no longer sorted in alphabetical and/or numeric order.

Thanks!

@peircej
Copy link
Member

peircej commented Nov 9, 2020

For context, the reason that this is True by default is that originally Python didn't support Ordered Dicts so it was either alphabetical or random! We used sorting to allow some sort of reason to the world! And then we kept it as the default for compatibility, but that's something I think we could change in the next major version update (where we permit changes in behaviour)

But the name aspect is surely a bug that we should fix!

peircej added a commit that referenced this issue Nov 13, 2020
BF: Correct param name for creating experiment info box, addresses #3279
@peircej peircej closed this as completed Nov 30, 2020
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

2 participants