Skip to content

Boolean config item always give 'False' value. #216

Closed
@idkwid2022

Description

@idkwid2022

Describe the bug

Boolean config items always give 'False' value even when set 'True' or 'true' in config.yaml.

Please see function setup_parser() on utils.py, on line 29. I think it's missing default value, like on line 31, or may be just skip checking the boolean type, and treat it like another?

def setup_parser():
with open("config.yaml", "r") as f:
config = yaml.safe_load(f.read())
parser = ArgumentParser()
parser.add_argument("--backend", default=None, type=str)
for k, v in config.items():
if isinstance(v, bool):
parser.add_argument(f"--{k}", action="store_true")
else:
parser.add_argument(f"--{k}", default=v, type=type(v))
return parser

Expected result

Boolean config items give value as set.

Steps to reproduce

Set any boolean config item in config.yaml to 'true'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions