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

Allow providing OrderedDict to the option postfix in the tqdm class #1577

Open
5 of 6 tasks
cgr71ii opened this issue Apr 30, 2024 · 0 comments
Open
5 of 6 tasks

Allow providing OrderedDict to the option postfix in the tqdm class #1577

cgr71ii opened this issue Apr 30, 2024 · 0 comments

Comments

@cgr71ii
Copy link

cgr71ii commented Apr 30, 2024

  • I have marked all applicable categories:
    • documentation request (i.e. "X is missing from the documentation." If instead I want to ask "how to use X?" I understand StackOverflow#tqdm is more appropriate)
    • new feature request
  • I have visited the source website, and in particular
    read the known issues
  • I have searched through the issue tracker for duplicates
  • I have mentioned version numbers, operating system and
    environment, where applicable: 4.66.2 3.10.2 | packaged by conda-forge | (main, Mar 8 2022, 15:53:57) [GCC 9.4.0] linux

Hi!

I've been using tqdm lately along with the set_postfix function. I noticed that in the documentation it says that you can provide not only a dict but also an OrderedDict. The OrderedDict works as expected, but the option postfix in the tqdm class does not work as expected if you provide an OrderedDict (i.e., the order is different from execution to execution, I guess that due to the PYTHONHASHSEED envvar or similar which helps to initialize the dictionaries order). In the documentation we can see that postfix: dict or *, optional, so the documentation is correct (i.e., it doesn't mention OrderedDict). But since for the set_postfix we can see that in the documentation allows dict or OrderedDict, I think that it makes sense that the postfix option of the tqdm class would also accept an OrderedDict to preserve the order of the parameters. I guess that the change shouldn't be too difficult since currently when postfix is provided in the tqdm class, it "calls set_postfix(**postfix)".

Thank you!

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