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

For boolean flags, confused on when to use "--no-*" pattern and when to "--flag True/False" pattern #140

Open
chengluberkeley opened this issue Apr 24, 2024 · 1 comment

Comments

@chengluberkeley
Copy link

Hello, I am reading the tyro documentation on the boolean flags: https://brentyi.github.io/tyro/examples/01_basics/05_flags/ and get confused. Because when I refer to Nerfstudio here: https://github.com/nerfstudio-project/nerfstudio/blob/main/nerfstudio/configs/base_config.py#L143, according to the documentation, since it has default value, it should have flags: --viewer.quit-on-train-completion and --viewer.no-quit-on-train-completion. But this one is translated in tyro to --viewer.quit-on-train-completion True/False. Do I miss something? Thanks.

@chengluberkeley chengluberkeley changed the title For boolean flags, confused on when to use "--no-*" pattern, or when to "flag True/False" pattern For boolean flags, confused on when to use "--no-*" pattern and when to "flag True/False" pattern Apr 24, 2024
@chengluberkeley chengluberkeley changed the title For boolean flags, confused on when to use "--no-*" pattern and when to "flag True/False" pattern For boolean flags, confused on when to use "--no-*" pattern and when to "--flag True/False" pattern Apr 24, 2024
@brentyi
Copy link
Owner

brentyi commented Apr 24, 2024

Hello!

The reason for this is that Nerfstudio types are often wrapped with tyro.conf.FlagConversionOff[]: https://github.com/search?q=repo%3Anerfstudio-project%2Fnerfstudio%20flagconversionoff&type=code

See here for an example: https://brentyi.github.io/tyro/examples/04_additional/07_conf/
Docs: https://brentyi.github.io/tyro/api/tyro/conf/#tyro.conf.FlagConversionOff

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