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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend arg parser #1842

Merged
merged 5 commits into from
May 14, 2020
Merged

extend arg parser #1842

merged 5 commits into from
May 14, 2020

Conversation

Borda
Copy link
Member

@Borda Borda commented May 14, 2020

What does this PR do?

Fixes #1829

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 馃檭

@Borda Borda added the feature Is an improvement or enhancement label May 14, 2020
@Borda Borda added this to the 0.7.6 milestone May 14, 2020
@pep8speaks
Copy link

pep8speaks commented May 14, 2020

Hello @Borda! Thanks for updating this PR.

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 馃嵒

Comment last updated at 2020-05-14 20:06:36 UTC

@mergify mergify bot requested a review from a team May 14, 2020 17:54
@mergify mergify bot requested a review from a team May 14, 2020 18:18
@codecov
Copy link

codecov bot commented May 14, 2020

Codecov Report

Merging #1842 into master will increase coverage by 0%.
The diff coverage is 96%.

@@          Coverage Diff           @@
##           master   #1842   +/-   ##
======================================
  Coverage      88%     88%           
======================================
  Files          71      71           
  Lines        4474    4485   +11     
======================================
+ Hits         3929    3946   +17     
+ Misses        545     539    -6     

def parse_argparse(cli_parser: ArgumentParser) -> Namespace:
"""Parse CLI arguments, required for custom bool types."""
args = vars(cli_parser.parse_args())
args = {k: True if v is None else v for k, v in args.items()}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about including this in the from_argparse_args method, since most user setup already is:

parser = argparse.ArgumentParser(...)
parser = pl.Trainer.add_argparse_args(parser)
args = parser.parser_args()
trainer = pl.Trainer.from_argparse_args(args)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds interesting :]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, pls check it now, plus added your code as example

@Borda Borda requested a review from williamFalcon May 14, 2020 19:46
@SkafteNicki
Copy link
Member

LGTM

@williamFalcon williamFalcon merged commit bee0392 into master May 14, 2020
@Borda Borda deleted the feature/arg-parse branch May 14, 2020 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Is an improvement or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow boolean flags to work without passing True
4 participants