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

Change hook_cfg type access to hook_cfg.get() #409

Merged

Conversation

lorinczszabolcs
Copy link

Motivation

Python dictionary does not support dot notation to access values. Fixes #396

Modification

Changed hook_cfg.type to hook_cfg.get('type', None).

Checklist

Before PR:

  • Pre-commit or other linting tools are used to fix the potential lint issues.
  • Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
  • The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, like docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects, like MMDet or MMSeg.
  • CLA has been signed and all committers have signed the CLA in this PR.

@codecov
Copy link

codecov bot commented Aug 9, 2022

Codecov Report

Merging #409 (26e6702) into dev (171a475) will not change coverage.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##              dev     #409   +/-   ##
=======================================
  Coverage   72.47%   72.47%           
=======================================
  Files         121      121           
  Lines        4759     4759           
  Branches      763      763           
=======================================
  Hits         3449     3449           
  Misses       1151     1151           
  Partials      159      159           
Flag Coverage Δ
unittests 72.47% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmselfsup/apis/train.py 47.77% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@fangyixiao18
Copy link
Collaborator

LGTM.

@YuanLiuuuuuu YuanLiuuuuuu merged commit 0617532 into open-mmlab:dev Aug 9, 2022
@lorinczszabolcs lorinczszabolcs deleted the 396-custom-hook-py-dict-get branch August 9, 2022 11:42
fangyixiao18 pushed a commit to fangyixiao18/mmselfsup that referenced this pull request Oct 1, 2022
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 this pull request may close these issues.

3 participants