Skip to content

[Docs] update config doc#1136

Open
tonysy wants to merge 3 commits intoopen-mmlab:dev-1.xfrom
tonysy:dev-1.x-config
Open

[Docs] update config doc#1136
tonysy wants to merge 3 commits intoopen-mmlab:dev-1.xfrom
tonysy:dev-1.x-config

Conversation

@tonysy
Copy link
Copy Markdown
Collaborator

@tonysy tonysy commented Oct 25, 2022

Update config doc

Motivation

Please describe the motivation of this PR and the goal you want to achieve through this PR.

Modification

Please briefly describe what modification is made in this PR.

BC-breaking (Optional)

Does the modification introduce changes that break the backward compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here and update the documentation.

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
Copy Markdown

codecov Bot commented Nov 2, 2022

Codecov Report

❌ Patch coverage is 0% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.19%. Comparing base (b8b31e9) to head (c3a2445).
⚠️ Report is 156 commits behind head on dev-1.x.

Files with missing lines Patch % Lines
mmcls/apis/list_registry.py 0.00% 16 Missing ⚠️
mmcls/apis/__init__.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           dev-1.x    #1136       +/-   ##
============================================
+ Coverage     0.02%   91.19%   +91.17%     
============================================
  Files          121      131       +10     
  Lines         8217     9792     +1575     
  Branches      1368     1542      +174     
============================================
+ Hits             2     8930     +8928     
+ Misses        8215      665     -7550     
- Partials         0      197      +197     
Flag Coverage Δ
unittests 91.19% <0.00%> (+91.17%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

from mmcls import registry
from mmcls.utils import register_all_modules

register_all_modules()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Better to use register_all_modules(init_default_scope=False), which won't influence the default scope settings.

Comment on lines +23 to +29
valid_registry = dict()
for attr in dir(registry):
attr_registry = getattr(registry, attr)
if isinstance(attr_registry, Registry):
valid_registry[attr] = attr_registry
else:
pass
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
valid_registry = dict()
for attr in dir(registry):
attr_registry = getattr(registry, attr)
if isinstance(attr_registry, Registry):
valid_registry[attr] = attr_registry
else:
pass
mmcls_registry = {k: getattr(registry, k) for k in registry.__all__}

Comment on lines +7 to +27
<!-- TOC -->

- [Learn about Configs](#learn-about-configs)
- [Philosophy of Configuration System](#philosophy-of-configuration-system)
- [Everything is Configurable](#everything-is-configurable)
- [Less Code, More Reuse](#less-new-code-more-reuse)
- [Make Custom Dataset/Model/Optimization Flexible](#make-custom-datasetmodeloptimization-flexible)
- [Happy Reading, Easy Coding](#happy-reading-easy-coding)
- [Overall of Config File](#overall-of-config-file)
- [Config Structure](#config-structure)
- [Model settings](#model-settings)
- [Data settings](#data-settings)
- [Schedule settings](#schedule-settings)
- [Runtime settings](#runtime-settings)
- [Inherit and Modify Config File](#inherit-and-modify-config-file)
- [Use intermediate variables in configs](#use-intermediate-variables-in-configs)
- [Ignore some fields in the base configs](#ignore-some-fields-in-the-base-configs)
- [Use some fields in the base configs](#use-some-fields-in-the-base-configs)
- [Modify Config in Command](#modify-config-in-command)

<!-- TOC -->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we don't need the TOC since there is already a TOC on the right side.

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.

2 participants