-
Notifications
You must be signed in to change notification settings - Fork 44
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
Argument Parser updated to use action="store_true" instead of 0/1 for boolean arguments. #72
Conversation
…/True for arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, store_true
was designed to do exactly that, a better choice. Thanks @ErikLarssonDev and welcome to NeuralLAM 🤝 🚀
Oh I just saw that the tests are failling now, you will have to update the last few lines of https://github.com/mllam/neural-lam/blob/main/tests/test_mllam_dataset.py:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Fix the tests as Simon pointed out and also add an entry in the changelog, then I can merge this in 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests work now, merging
Describe your changes
I have replaced the parser.add_argument where the standard has been to have an integer 0=False, 1=True with an action="store_true" instead.
Example:
OLD:
parser.add_argument(
"--restore_opt",
type=int,
default=0,
help="If optimizer state should be restored with model "
"(default: 0 (false))",
)
NEW:
parser.add_argument(
"--restore_opt",
action="store_true",
help="If optimizer state should be restored with model "
"(default: false)",
)
This will save some time and characters when running the scripts from the command line as well as being easier to understand as the parsed variables are supposed to be booleans.
Issue Link
I don't have an issue.
Type of change
You are not able to run the scripts from the command line using old syntax with 0/1 for False/True.
Checklist before requesting a review
pull
with--rebase
option if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee