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

Refactor/move args to kwargs #833

Merged
merged 43 commits into from
Feb 21, 2022
Merged

Refactor/move args to kwargs #833

merged 43 commits into from
Feb 21, 2022

Conversation

SkafteNicki
Copy link
Member

@SkafteNicki SkafteNicki commented Feb 10, 2022

What does this PR do?

Move the three common arguments dist_sync_on_step, process_group and dist_sync_fn to a kwargs argument.
The arguments are only meant for real power-users and therefore it does not make sense that they need to be directly available as arguments. This solution is complete backwards compatible and it is therefore more a question about getting more clean documentation as we do not need to repeat theses arguments everywhere.

Currently only updated one metric so we can agree on the refactor before applying it to all other metrics.

Before submitting

  • Was this discussed/approved via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

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 🙃

@SkafteNicki SkafteNicki added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 10, 2022
@SkafteNicki SkafteNicki added this to the v0.8 milestone Feb 10, 2022
docs/source/pages/overview.rst Outdated Show resolved Hide resolved
docs/source/pages/overview.rst Outdated Show resolved Hide resolved
docs/source/pages/overview.rst Outdated Show resolved Hide resolved
docs/source/pages/overview.rst Show resolved Hide resolved
docs/source/pages/overview.rst Outdated Show resolved Hide resolved
torchmetrics/metric.py Outdated Show resolved Hide resolved
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
@Borda Borda requested review from justusschock and Borda February 16, 2022 19:13
Copy link
Member

@Borda Borda left a comment

Choose a reason for hiding this comment

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

why do some have metric_kwargs and others metric_kwargs?

@SkafteNicki
Copy link
Member Author

why do some have metric_kwargs and others metric_kwargs?

Sorry, my intension was that all should just be kwargs. Should be fixed now :]

@mergify mergify bot added the ready label Feb 17, 2022
@Borda Borda merged commit 478576e into master Feb 21, 2022
@Borda Borda deleted the refactor/move_args_to_kwargs branch February 21, 2022 11:26
@Borda Borda added this to the v0.8 milestone May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request ready
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants