diff --git a/configclass/index.html b/configclass/index.html index 3002ba86..1bd58692 100644 --- a/configclass/index.html +++ b/configclass/index.html @@ -1087,7 +1087,8 @@

Source code in chanfig/configclasses.py -
Python
25
+              
Python
24
+25
 26
 27
 28
@@ -1132,54 +1133,53 @@ 

67 68 69 -70 -71

def configclass(cls=None):
-    """
-    Construct a Config in [`dataclass`][dataclasses.dataclass] style.
-
-    This decorator creates a Config instance with the provided class attributes.
-
-    See Also:
-        [`dataclass`][dataclasses.dataclass]
-
-    Args:
-        cls (Type[Any]): The class to be enhanced, provided directly if no parentheses are used.
-
-    Returns:
-        A modified class with Config functionalities or a decorator with bound parameters.
-
-    Examples:
-        >>> @configclass
-        ... class DataloaderConfig:
-        ...     batch_size: int = 64
-        ...     num_workers: int = 4
-        ...     pin_memory: bool = True
-        >>> config = DataloaderConfig()
-        >>> print(config)
-        DataloaderConfig(<class 'chanfig.config.Config'>,
-          ('batch_size'): 64
-          ('num_workers'): 4
-          ('pin_memory'): True
-        )
-    """
-
-    warn(
-        "This decorator is deprecated and may be removed in the future release. "
-        "All chanfig classes will copy variable identified in `__annotations__` by default."
-        "This decorator is equivalent to inheriting from `Config`.",
-        PendingDeprecationWarning,
-    )
-
-    def decorator(cls: Type[Any]):
-        if not issubclass(cls, Config):
-            config_cls = type(cls.__name__, (Config, cls), dict(cls.__dict__))
-            cls = config_cls
-
-        return cls
-
-    if cls is None:
-        return decorator
-    return decorator(cls)
+70
def configclass(cls=None):
+    """
+    Construct a Config in [`dataclass`][dataclasses.dataclass] style.
+
+    This decorator creates a Config instance with the provided class attributes.
+
+    See Also:
+        [`dataclass`][dataclasses.dataclass]
+
+    Args:
+        cls (Type[Any]): The class to be enhanced, provided directly if no parentheses are used.
+
+    Returns:
+        A modified class with Config functionalities or a decorator with bound parameters.
+
+    Examples:
+        >>> @configclass
+        ... class DataloaderConfig:
+        ...     batch_size: int = 64
+        ...     num_workers: int = 4
+        ...     pin_memory: bool = True
+        >>> config = DataloaderConfig()
+        >>> print(config)
+        DataloaderConfig(<class 'chanfig.config.Config'>,
+          ('batch_size'): 64
+          ('num_workers'): 4
+          ('pin_memory'): True
+        )
+    """
+
+    warn(
+        "This decorator is deprecated and may be removed in the future release. "
+        "All chanfig classes will copy variable identified in `__annotations__` by default."
+        "This decorator is equivalent to inheriting from `Config`.",
+        PendingDeprecationWarning,
+    )
+
+    def decorator(cls: Type[Any]):
+        if not issubclass(cls, Config):
+            config_cls = type(cls.__name__, (Config, cls), dict(cls.__dict__))
+            cls = config_cls
+
+        return cls
+
+    if cls is None:
+        return decorator
+    return decorator(cls)
 
diff --git a/feed_rss_created.xml b/feed_rss_created.xml index dd12e88c..483137e8 100644 --- a/feed_rss_created.xml +++ b/feed_rss_created.xml @@ -1 +1 @@ - CHANfiGEasier Configurationhttps://chanfig.danling.org/CHANfiG Contributorshttps://github.com/ZhiyuanChen/CHANfiGen Wed, 21 Aug 2024 16:01:09 -0000 Wed, 21 Aug 2024 16:01:09 -0000 1440 MkDocs RSS plugin - v1.15.0 About <h1>About</h1><p style="text-align: center;">Developed by DanLing on Earth</p><p>We are a community of developers, designers, and others from around the world who ...</p>https://chanfig.danling.org/about/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/about/ 关于 <h1>关于</h1><p style="text-align: center;">由丹灵在地球开发</p><p>我们是一个由开发者、设计人员和其他人员组成的社区,致力于让深度学习技术更加开放。</p><p>我们是一个由个体组成的社区,致力于推动深度学习的可能性边界。</p><p>我们对深度学习及其用户充满激情。</p><p>我们是丹灵。</p>https://chanfig.danling.org/zh/about/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/zh/about/ License <h1>GNU AFFERO GENERAL PUBLIC LICENSE</h1><p>Version 3, 19 November 2007</p><p>Copyright (C) 2007 Free Software Foundation, Inc.<a href="https://fsf.org/">https://fsf.org/</a></p><p>Everyone is permitted...</p>https://chanfig.danling.org/about/license/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/about/license/ Privacy Notice <p>!!! info "Last Revised Date"</p><pre><code>This notice was last updated on May 04, 2024.</code></pre><h1>Privacy Notice</h1><p>This privacy notice for DanLing Team (also known as DanLin...</p>https://chanfig.danling.org/about/privacy/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/about/privacy/ License <p>!!! warning "翻译"</p><pre><code>本文内容为翻译版本,旨在为用户提供方便。我们已经尽力确保翻译的准确性。但请注意,翻译内容可能包含错误,仅供参考。请以英文[原文](https://multimolecule.danling.org/about/license)为准。</code></pre><p>...</p>https://chanfig.danling.org/zh/about/license/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/zh/about/license/ Privacy Notice <p>!!! warning "翻译"</p><pre><code>本文内容为机器翻译版本,旨在为用户提供方便。我们已经尽力确保翻译的准确性。但请注意,翻译内容可能包含错误,仅供参考。请以英文[原文](https://chanfig.danling.org/about/privacy)为准。为满...</code></pre>https://chanfig.danling.org/zh/about/privacy/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/zh/about/privacy/ CHANfiG <h1>CHANfiG</h1>https://chanfig.danling.org/blog/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/blog/ CHANfiG <h1>CHANfiG</h1>https://chanfig.danling.org/zh/blog/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/zh/blog/ Home Zhiyuan Chen <p>--8&lt;-- "README.md"</p>https://chanfig.danling.org/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/ Config Zhiyuan Chen <h1>Config</h1><p>::: chanfig.config</p>https://chanfig.danling.org/config/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/config/ configclass Zhiyuan Chen <h1>configclass</h1><p>::: chanfig.configclasses</p>https://chanfig.danling.org/configclass/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/configclass/ DefaultDict Zhiyuan Chen <h1>DefaultDict</h1><p>::: chanfig.DefaultDict</p>https://chanfig.danling.org/default_dict/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/default_dict/ FlatDict Zhiyuan Chen <h1>FlatDict</h1><p>::: chanfig.FlatDict</p>https://chanfig.danling.org/flat_dict/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/flat_dict/ Functional Zhiyuan Chen <h1>Functional</h1><p>::: chanfig.to_dictoptions:heading_level: 0</p><p>::: chanfig.saveoptions:heading_level: 0</p><p>::: chanfig.loadoptions:heading_level: 0</p><p>::: chan...</p>https://chanfig.danling.org/functional/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/functional/ NestedDict Zhiyuan Chen <h1>NestedDict</h1><p>::: chanfig.NestedDict</p>https://chanfig.danling.org/nested_dict/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/nested_dict/ ConfigParser Zhiyuan Chen <h1>ConfigParser</h1><p>::: chanfig.ConfigParser</p>https://chanfig.danling.org/parser/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/parser/ Registry Zhiyuan Chen <h1>Registry</h1><p>::: chanfig.registry</p>https://chanfig.danling.org/registry/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/registry/ Utilities Zhiyuan Chen <h1>Utilities</h1><p>::: chanfig.utils.Singletonoptions:heading_level: 0</p><h2>chanfig.utils.Null</h2><p><code>Null</code> is an instance of [<code>NULL</code>][chanfig.utils.NULL].</p><p>Since the ...</p>https://chanfig.danling.org/utils/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/utils/ Variable Zhiyuan Chen <h1>Variable</h1><p>::: chanfig.Variable</p>https://chanfig.danling.org/variable/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/variable/ Index Zhiyuan Chen <p>--8&lt;-- "README.zh.md"</p>https://chanfig.danling.org/zh/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/zh/ \ No newline at end of file + CHANfiGEasier Configurationhttps://chanfig.danling.org/CHANfiG Contributorshttps://github.com/ZhiyuanChen/CHANfiGen Wed, 21 Aug 2024 16:07:25 -0000 Wed, 21 Aug 2024 16:07:25 -0000 1440 MkDocs RSS plugin - v1.15.0 About <h1>About</h1><p style="text-align: center;">Developed by DanLing on Earth</p><p>We are a community of developers, designers, and others from around the world who ...</p>https://chanfig.danling.org/about/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/about/ 关于 <h1>关于</h1><p style="text-align: center;">由丹灵在地球开发</p><p>我们是一个由开发者、设计人员和其他人员组成的社区,致力于让深度学习技术更加开放。</p><p>我们是一个由个体组成的社区,致力于推动深度学习的可能性边界。</p><p>我们对深度学习及其用户充满激情。</p><p>我们是丹灵。</p>https://chanfig.danling.org/zh/about/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/zh/about/ License <h1>GNU AFFERO GENERAL PUBLIC LICENSE</h1><p>Version 3, 19 November 2007</p><p>Copyright (C) 2007 Free Software Foundation, Inc.<a href="https://fsf.org/">https://fsf.org/</a></p><p>Everyone is permitted...</p>https://chanfig.danling.org/about/license/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/about/license/ Privacy Notice <p>!!! info "Last Revised Date"</p><pre><code>This notice was last updated on May 04, 2024.</code></pre><h1>Privacy Notice</h1><p>This privacy notice for DanLing Team (also known as DanLin...</p>https://chanfig.danling.org/about/privacy/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/about/privacy/ License <p>!!! warning "翻译"</p><pre><code>本文内容为翻译版本,旨在为用户提供方便。我们已经尽力确保翻译的准确性。但请注意,翻译内容可能包含错误,仅供参考。请以英文[原文](https://multimolecule.danling.org/about/license)为准。</code></pre><p>...</p>https://chanfig.danling.org/zh/about/license/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/zh/about/license/ Privacy Notice <p>!!! warning "翻译"</p><pre><code>本文内容为机器翻译版本,旨在为用户提供方便。我们已经尽力确保翻译的准确性。但请注意,翻译内容可能包含错误,仅供参考。请以英文[原文](https://chanfig.danling.org/about/privacy)为准。为满...</code></pre>https://chanfig.danling.org/zh/about/privacy/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/zh/about/privacy/ CHANfiG <h1>CHANfiG</h1>https://chanfig.danling.org/blog/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/blog/ CHANfiG <h1>CHANfiG</h1>https://chanfig.danling.org/zh/blog/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/zh/blog/ Home Zhiyuan Chen <p>--8&lt;-- "README.md"</p>https://chanfig.danling.org/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/ Config Zhiyuan Chen <h1>Config</h1><p>::: chanfig.config</p>https://chanfig.danling.org/config/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/config/ configclass Zhiyuan Chen <h1>configclass</h1><p>::: chanfig.configclasses</p>https://chanfig.danling.org/configclass/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/configclass/ DefaultDict Zhiyuan Chen <h1>DefaultDict</h1><p>::: chanfig.DefaultDict</p>https://chanfig.danling.org/default_dict/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/default_dict/ FlatDict Zhiyuan Chen <h1>FlatDict</h1><p>::: chanfig.FlatDict</p>https://chanfig.danling.org/flat_dict/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/flat_dict/ Functional Zhiyuan Chen <h1>Functional</h1><p>::: chanfig.to_dictoptions:heading_level: 0</p><p>::: chanfig.saveoptions:heading_level: 0</p><p>::: chanfig.loadoptions:heading_level: 0</p><p>::: chan...</p>https://chanfig.danling.org/functional/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/functional/ NestedDict Zhiyuan Chen <h1>NestedDict</h1><p>::: chanfig.NestedDict</p>https://chanfig.danling.org/nested_dict/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/nested_dict/ ConfigParser Zhiyuan Chen <h1>ConfigParser</h1><p>::: chanfig.ConfigParser</p>https://chanfig.danling.org/parser/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/parser/ Registry Zhiyuan Chen <h1>Registry</h1><p>::: chanfig.registry</p>https://chanfig.danling.org/registry/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/registry/ Utilities Zhiyuan Chen <h1>Utilities</h1><p>::: chanfig.utils.Singletonoptions:heading_level: 0</p><h2>chanfig.utils.Null</h2><p><code>Null</code> is an instance of [<code>NULL</code>][chanfig.utils.NULL].</p><p>Since the ...</p>https://chanfig.danling.org/utils/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/utils/ Variable Zhiyuan Chen <h1>Variable</h1><p>::: chanfig.Variable</p>https://chanfig.danling.org/variable/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/variable/ Index Zhiyuan Chen <p>--8&lt;-- "README.zh.md"</p>https://chanfig.danling.org/zh/ Wed, 04 May 2022 00:00:00 +0000CHANfiGhttps://chanfig.danling.org/zh/ \ No newline at end of file diff --git a/feed_rss_updated.xml b/feed_rss_updated.xml index 997c0af4..92ec61f8 100644 --- a/feed_rss_updated.xml +++ b/feed_rss_updated.xml @@ -1 +1 @@ - CHANfiGEasier Configurationhttps://chanfig.danling.org/CHANfiG Contributorshttps://github.com/ZhiyuanChen/CHANfiGen Wed, 21 Aug 2024 16:01:09 -0000 Wed, 21 Aug 2024 16:01:09 -0000 1440 MkDocs RSS plugin - v1.15.0 About <h1>About</h1><p style="text-align: center;">Developed by DanLing on Earth</p><p>We are a community of developers, designers, and others from around the world who ...</p>https://chanfig.danling.org/about/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/about/ Privacy Notice <p>!!! info "Last Revised Date"</p><pre><code>This notice was last updated on May 04, 2024.</code></pre><h1>Privacy Notice</h1><p>This privacy notice for DanLing Team (also known as DanLin...</p>https://chanfig.danling.org/about/privacy/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/about/privacy/ 关于 <h1>关于</h1><p style="text-align: center;">由丹灵在地球开发</p><p>我们是一个由开发者、设计人员和其他人员组成的社区,致力于让深度学习技术更加开放。</p><p>我们是一个由个体组成的社区,致力于推动深度学习的可能性边界。</p><p>我们对深度学习及其用户充满激情。</p><p>我们是丹灵。</p>https://chanfig.danling.org/zh/about/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/zh/about/ Privacy Notice <p>!!! warning "翻译"</p><pre><code>本文内容为机器翻译版本,旨在为用户提供方便。我们已经尽力确保翻译的准确性。但请注意,翻译内容可能包含错误,仅供参考。请以英文[原文](https://chanfig.danling.org/about/privacy)为准。为满...</code></pre>https://chanfig.danling.org/zh/about/privacy/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/zh/about/privacy/ License <h1>GNU AFFERO GENERAL PUBLIC LICENSE</h1><p>Version 3, 19 November 2007</p><p>Copyright (C) 2007 Free Software Foundation, Inc.<a href="https://fsf.org/">https://fsf.org/</a></p><p>Everyone is permitted...</p>https://chanfig.danling.org/about/license/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/about/license/ License <p>!!! warning "翻译"</p><pre><code>本文内容为翻译版本,旨在为用户提供方便。我们已经尽力确保翻译的准确性。但请注意,翻译内容可能包含错误,仅供参考。请以英文[原文](https://multimolecule.danling.org/about/license)为准。</code></pre><p>...</p>https://chanfig.danling.org/zh/about/license/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/zh/about/license/ Registry Zhiyuan Chen <h1>Registry</h1><p>::: chanfig.registry</p>https://chanfig.danling.org/registry/ Thu, 28 Mar 2024 11:05:48 +0000CHANfiGhttps://chanfig.danling.org/registry/ Registry Zhiyuan Chen <h1>Registry</h1><p>::: chanfig.registry</p>https://chanfig.danling.org/zh/registry/ Thu, 28 Mar 2024 11:05:48 +0000CHANfiGhttps://chanfig.danling.org/zh/registry/ configclass Zhiyuan Chen <h1>configclass</h1><p>::: chanfig.configclasses</p>https://chanfig.danling.org/configclass/ Fri, 08 Mar 2024 08:01:02 +0000CHANfiGhttps://chanfig.danling.org/configclass/ configclass Zhiyuan Chen <h1>configclass</h1><p>::: chanfig.configclasses</p>https://chanfig.danling.org/zh/configclass/ Fri, 08 Mar 2024 08:01:02 +0000CHANfiGhttps://chanfig.danling.org/zh/configclass/ Functional Zhiyuan Chen <h1>Functional</h1><p>::: chanfig.to_dictoptions:heading_level: 0</p><p>::: chanfig.saveoptions:heading_level: 0</p><p>::: chanfig.loadoptions:heading_level: 0</p><p>::: chan...</p>https://chanfig.danling.org/functional/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/functional/ ConfigParser Zhiyuan Chen <h1>ConfigParser</h1><p>::: chanfig.ConfigParser</p>https://chanfig.danling.org/parser/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/parser/ Utilities Zhiyuan Chen <h1>Utilities</h1><p>::: chanfig.utils.Singletonoptions:heading_level: 0</p><h2>chanfig.utils.Null</h2><p><code>Null</code> is an instance of [<code>NULL</code>][chanfig.utils.NULL].</p><p>Since the ...</p>https://chanfig.danling.org/utils/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/utils/ Functional Zhiyuan Chen <h1>Functional</h1><p>::: chanfig.to_dictoptions:heading_level: 0</p><p>::: chanfig.saveoptions:heading_level: 0</p><p>::: chanfig.loadoptions:heading_level: 0</p><p>::: chan...</p>https://chanfig.danling.org/zh/functional/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/zh/functional/ ConfigParser Zhiyuan Chen <h1>ConfigParser</h1><p>::: chanfig.ConfigParser</p>https://chanfig.danling.org/zh/parser/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/zh/parser/ Utilities Zhiyuan Chen <h1>Utilities</h1><p>::: chanfig.utils.Singletonoptions:heading_level: 0</p><h2>chanfig.utils.Null</h2><p><code>Null</code> is an instance of [<code>NULL</code>][chanfig.utils.NULL].</p><p>Since the ...</p>https://chanfig.danling.org/zh/utils/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/zh/utils/ Home Zhiyuan Chen <p>--8&lt;-- "README.md"</p>https://chanfig.danling.org/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/ Config Zhiyuan Chen <h1>Config</h1><p>::: chanfig.config</p>https://chanfig.danling.org/config/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/config/ DefaultDict Zhiyuan Chen <h1>DefaultDict</h1><p>::: chanfig.DefaultDict</p>https://chanfig.danling.org/default_dict/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/default_dict/ FlatDict Zhiyuan Chen <h1>FlatDict</h1><p>::: chanfig.FlatDict</p>https://chanfig.danling.org/flat_dict/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/flat_dict/ \ No newline at end of file + CHANfiGEasier Configurationhttps://chanfig.danling.org/CHANfiG Contributorshttps://github.com/ZhiyuanChen/CHANfiGen Wed, 21 Aug 2024 16:07:25 -0000 Wed, 21 Aug 2024 16:07:25 -0000 1440 MkDocs RSS plugin - v1.15.0 About <h1>About</h1><p style="text-align: center;">Developed by DanLing on Earth</p><p>We are a community of developers, designers, and others from around the world who ...</p>https://chanfig.danling.org/about/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/about/ Privacy Notice <p>!!! info "Last Revised Date"</p><pre><code>This notice was last updated on May 04, 2024.</code></pre><h1>Privacy Notice</h1><p>This privacy notice for DanLing Team (also known as DanLin...</p>https://chanfig.danling.org/about/privacy/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/about/privacy/ 关于 <h1>关于</h1><p style="text-align: center;">由丹灵在地球开发</p><p>我们是一个由开发者、设计人员和其他人员组成的社区,致力于让深度学习技术更加开放。</p><p>我们是一个由个体组成的社区,致力于推动深度学习的可能性边界。</p><p>我们对深度学习及其用户充满激情。</p><p>我们是丹灵。</p>https://chanfig.danling.org/zh/about/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/zh/about/ Privacy Notice <p>!!! warning "翻译"</p><pre><code>本文内容为机器翻译版本,旨在为用户提供方便。我们已经尽力确保翻译的准确性。但请注意,翻译内容可能包含错误,仅供参考。请以英文[原文](https://chanfig.danling.org/about/privacy)为准。为满...</code></pre>https://chanfig.danling.org/zh/about/privacy/ Mon, 29 Jul 2024 20:39:24 +0000CHANfiGhttps://chanfig.danling.org/zh/about/privacy/ License <h1>GNU AFFERO GENERAL PUBLIC LICENSE</h1><p>Version 3, 19 November 2007</p><p>Copyright (C) 2007 Free Software Foundation, Inc.<a href="https://fsf.org/">https://fsf.org/</a></p><p>Everyone is permitted...</p>https://chanfig.danling.org/about/license/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/about/license/ License <p>!!! warning "翻译"</p><pre><code>本文内容为翻译版本,旨在为用户提供方便。我们已经尽力确保翻译的准确性。但请注意,翻译内容可能包含错误,仅供参考。请以英文[原文](https://multimolecule.danling.org/about/license)为准。</code></pre><p>...</p>https://chanfig.danling.org/zh/about/license/ Mon, 08 Jul 2024 05:11:39 +0000CHANfiGhttps://chanfig.danling.org/zh/about/license/ Registry Zhiyuan Chen <h1>Registry</h1><p>::: chanfig.registry</p>https://chanfig.danling.org/registry/ Thu, 28 Mar 2024 11:05:48 +0000CHANfiGhttps://chanfig.danling.org/registry/ Registry Zhiyuan Chen <h1>Registry</h1><p>::: chanfig.registry</p>https://chanfig.danling.org/zh/registry/ Thu, 28 Mar 2024 11:05:48 +0000CHANfiGhttps://chanfig.danling.org/zh/registry/ configclass Zhiyuan Chen <h1>configclass</h1><p>::: chanfig.configclasses</p>https://chanfig.danling.org/configclass/ Fri, 08 Mar 2024 08:01:02 +0000CHANfiGhttps://chanfig.danling.org/configclass/ configclass Zhiyuan Chen <h1>configclass</h1><p>::: chanfig.configclasses</p>https://chanfig.danling.org/zh/configclass/ Fri, 08 Mar 2024 08:01:02 +0000CHANfiGhttps://chanfig.danling.org/zh/configclass/ Functional Zhiyuan Chen <h1>Functional</h1><p>::: chanfig.to_dictoptions:heading_level: 0</p><p>::: chanfig.saveoptions:heading_level: 0</p><p>::: chanfig.loadoptions:heading_level: 0</p><p>::: chan...</p>https://chanfig.danling.org/functional/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/functional/ ConfigParser Zhiyuan Chen <h1>ConfigParser</h1><p>::: chanfig.ConfigParser</p>https://chanfig.danling.org/parser/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/parser/ Utilities Zhiyuan Chen <h1>Utilities</h1><p>::: chanfig.utils.Singletonoptions:heading_level: 0</p><h2>chanfig.utils.Null</h2><p><code>Null</code> is an instance of [<code>NULL</code>][chanfig.utils.NULL].</p><p>Since the ...</p>https://chanfig.danling.org/utils/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/utils/ Functional Zhiyuan Chen <h1>Functional</h1><p>::: chanfig.to_dictoptions:heading_level: 0</p><p>::: chanfig.saveoptions:heading_level: 0</p><p>::: chanfig.loadoptions:heading_level: 0</p><p>::: chan...</p>https://chanfig.danling.org/zh/functional/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/zh/functional/ ConfigParser Zhiyuan Chen <h1>ConfigParser</h1><p>::: chanfig.ConfigParser</p>https://chanfig.danling.org/zh/parser/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/zh/parser/ Utilities Zhiyuan Chen <h1>Utilities</h1><p>::: chanfig.utils.Singletonoptions:heading_level: 0</p><h2>chanfig.utils.Null</h2><p><code>Null</code> is an instance of [<code>NULL</code>][chanfig.utils.NULL].</p><p>Since the ...</p>https://chanfig.danling.org/zh/utils/ Wed, 26 Jul 2023 17:37:04 +0000CHANfiGhttps://chanfig.danling.org/zh/utils/ Home Zhiyuan Chen <p>--8&lt;-- "README.md"</p>https://chanfig.danling.org/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/ Config Zhiyuan Chen <h1>Config</h1><p>::: chanfig.config</p>https://chanfig.danling.org/config/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/config/ DefaultDict Zhiyuan Chen <h1>DefaultDict</h1><p>::: chanfig.DefaultDict</p>https://chanfig.danling.org/default_dict/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/default_dict/ FlatDict Zhiyuan Chen <h1>FlatDict</h1><p>::: chanfig.FlatDict</p>https://chanfig.danling.org/flat_dict/ Thu, 20 Jul 2023 17:14:16 +0000CHANfiGhttps://chanfig.danling.org/flat_dict/ \ No newline at end of file diff --git a/zh/configclass/index.html b/zh/configclass/index.html index 53298760..376a3e24 100644 --- a/zh/configclass/index.html +++ b/zh/configclass/index.html @@ -1091,7 +1091,8 @@

Source code in chanfig/configclasses.py -
Python
25
+              
Python
24
+25
 26
 27
 28
@@ -1136,54 +1137,53 @@ 

67 68 69 -70 -71

def configclass(cls=None):
-    """
-    Construct a Config in [`dataclass`][dataclasses.dataclass] style.
-
-    This decorator creates a Config instance with the provided class attributes.
-
-    See Also:
-        [`dataclass`][dataclasses.dataclass]
-
-    Args:
-        cls (Type[Any]): The class to be enhanced, provided directly if no parentheses are used.
-
-    Returns:
-        A modified class with Config functionalities or a decorator with bound parameters.
-
-    Examples:
-        >>> @configclass
-        ... class DataloaderConfig:
-        ...     batch_size: int = 64
-        ...     num_workers: int = 4
-        ...     pin_memory: bool = True
-        >>> config = DataloaderConfig()
-        >>> print(config)
-        DataloaderConfig(<class 'chanfig.config.Config'>,
-          ('batch_size'): 64
-          ('num_workers'): 4
-          ('pin_memory'): True
-        )
-    """
-
-    warn(
-        "This decorator is deprecated and may be removed in the future release. "
-        "All chanfig classes will copy variable identified in `__annotations__` by default."
-        "This decorator is equivalent to inheriting from `Config`.",
-        PendingDeprecationWarning,
-    )
-
-    def decorator(cls: Type[Any]):
-        if not issubclass(cls, Config):
-            config_cls = type(cls.__name__, (Config, cls), dict(cls.__dict__))
-            cls = config_cls
-
-        return cls
-
-    if cls is None:
-        return decorator
-    return decorator(cls)
+70
def configclass(cls=None):
+    """
+    Construct a Config in [`dataclass`][dataclasses.dataclass] style.
+
+    This decorator creates a Config instance with the provided class attributes.
+
+    See Also:
+        [`dataclass`][dataclasses.dataclass]
+
+    Args:
+        cls (Type[Any]): The class to be enhanced, provided directly if no parentheses are used.
+
+    Returns:
+        A modified class with Config functionalities or a decorator with bound parameters.
+
+    Examples:
+        >>> @configclass
+        ... class DataloaderConfig:
+        ...     batch_size: int = 64
+        ...     num_workers: int = 4
+        ...     pin_memory: bool = True
+        >>> config = DataloaderConfig()
+        >>> print(config)
+        DataloaderConfig(<class 'chanfig.config.Config'>,
+          ('batch_size'): 64
+          ('num_workers'): 4
+          ('pin_memory'): True
+        )
+    """
+
+    warn(
+        "This decorator is deprecated and may be removed in the future release. "
+        "All chanfig classes will copy variable identified in `__annotations__` by default."
+        "This decorator is equivalent to inheriting from `Config`.",
+        PendingDeprecationWarning,
+    )
+
+    def decorator(cls: Type[Any]):
+        if not issubclass(cls, Config):
+            config_cls = type(cls.__name__, (Config, cls), dict(cls.__dict__))
+            cls = config_cls
+
+        return cls
+
+    if cls is None:
+        return decorator
+    return decorator(cls)