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

strict argument doesn't seem to work as expected #21

Open
karol-brejna-i opened this issue May 14, 2021 · 1 comment · May be fixed by #27
Open

strict argument doesn't seem to work as expected #21

karol-brejna-i opened this issue May 14, 2021 · 1 comment · May be fixed by #27

Comments

@karol-brejna-i
Copy link
Collaborator

karol-brejna-i commented May 14, 2021

Consider the following pseudocode (in main):

settings = parser.parse_args()
print(f'strict value: {settings.strict}')
print(f'strict type: {type(settings.strict)}')
print(f'strict boolean: {bool(settings.strict)}')

The following invocation:

(.venv) pgn-tactics-generator$ ./main.py --strict=False

would produce unwanted results:

strict value: False
strict type: <class 'str'>
strict boolean: True
Looking up stockfish-x86_64-bmi2 ...

strict variable value is 'False' (string). bool( evaluates to True...

Probably something similar to

parser.add_argument("--includeBlunder", metavar="INCLUDE_BLUNDER", default=True,
type=str2bool, const=True, dest="include_blunder", nargs="?",
help="If False then generated puzzles won't include initial blunder move")
would fix the issue.

@karol-brejna-i karol-brejna-i changed the title strict argument doesn strict argument doesn't seem to work as expected May 14, 2021
@vitogit
Copy link
Owner

vitogit commented May 22, 2021

The solution looks good to me

@karol-brejna-i karol-brejna-i linked a pull request Jun 8, 2021 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants