You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><p><strong>Submodule ``__all__``</strong>: Each submodule defines its own <codeclass="docutils literal notranslate"><spanclass="pre">__all__</span></code>
822
+
<li><p><strong>Submodule __all__</strong>: Each submodule defines its own <codeclass="docutils literal notranslate"><spanclass="pre">__all__</span></code>
823
823
list</p></li>
824
-
<li><p><strong>Subpackage ``__init__.py``</strong>: The subpackage <codeclass="docutils literal notranslate"><spanclass="pre">__init__.py</span></code> uses
824
+
<li><p><strong>Subpackage __init__.py</strong>: The subpackage <codeclass="docutils literal notranslate"><spanclass="pre">__init__.py</span></code> uses
825
825
<codeclass="docutils literal notranslate"><spanclass="pre">from</span><spanclass="pre">._module</span><spanclass="pre">import</span><spanclass="pre">*</span></code> to assemble the package</p></li>
826
826
</ol>
827
-
<p><strong>Example structure for ``_memory/`` subpackage:</strong></p>
827
+
<p><strong>Example structure for _memory/ subpackage:</strong></p>
<h3>Guidelines<aclass="headerlink" href="#guidelines" title="Link to this heading">#</a></h3>
875
875
<olclass="arabic simple">
876
-
<li><p><strong>Always create ``.pxd`` files for shared Cython types</strong>: If a class
876
+
<li><p><strong>Always create .pxd files for shared Cython types</strong>: If a class
877
877
or function is <codeclass="docutils literal notranslate"><spanclass="pre">cimport</span></code>ed by other modules, provide a <codeclass="docutils literal notranslate"><spanclass="pre">.pxd</span></code>
878
878
declaration file.</p></li>
879
-
<li><p><strong>Keep ``.pxd`` files minimal</strong>: Only include declarations needed for
879
+
<li><p><strong>Keep .pxd files minimal</strong>: Only include declarations needed for
880
880
Cython compilation. Omit implementation details, docstrings, and
881
881
Python-only code.</p></li>
882
-
<li><p><strong>Use ``__all__`` when helpful</strong>: Define <codeclass="docutils literal notranslate"><spanclass="pre">__all__</span></code> to control
882
+
<li><p><strong>Use __all__ when helpful</strong>: Define <codeclass="docutils literal notranslate"><spanclass="pre">__all__</span></code> to control
883
883
exported symbols when it simplifies or clarifies the module
884
884
structure.</p></li>
885
-
<li><p><strong>Use ``from ._module import *`` in subpackage ``__init__.py``</strong>:
885
+
<li><p><strong>Use from ._module import * in subpackage __init__.py</strong>:
886
886
This pattern assembles the subpackage API from its submodules. Use
887
887
<codeclass="docutils literal notranslate"><spanclass="pre">#</span><spanclass="pre">noqa:</span><spanclass="pre">F403</span></code> to suppress linting warnings about wildcard imports.</p></li>
888
888
<li><p><strong>Migrate to subpackage structure when complex</strong>: When a top-level
@@ -986,7 +986,7 @@ <h3>Additional Rules<a class="headerlink" href="#additional-rules" title="Link t
986
986
<li><p><strong>Blank Lines</strong>: Use blank lines to separate the five import groups.
987
987
Do not use blank lines within a group unless using multi-line import
988
988
formatting.</p></li>
989
-
<li><p><strong>``try/except`` Blocks</strong>: Import fallbacks (e.g., for optional
989
+
<li><p><strong>try/except blocks</strong>: Import fallbacks (e.g., for optional
990
990
dependencies) should be placed in the appropriate group (external or
991
991
cuda-core) using <codeclass="docutils literal notranslate"><spanclass="pre">try/except</span></code> blocks.</p></li>
<spanid="id18"></span><h4>Guidelines<aclass="headerlink" href="#guidelines-1" title="Link to this heading">#</a></h4>
1237
1237
<olclass="arabic simple">
1238
-
<li><p><strong>Use ``from __future__ import annotations``</strong>: This should be
1238
+
<li><p><strong>Use from __future__ import annotations</strong>: This should be
1239
1239
present in all <codeclass="docutils literal notranslate"><spanclass="pre">.py</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">.pyx</span></code> files with type annotations.</p></li>
1240
-
<li><p><strong>Use ``|`` for unions</strong>: Prefer <codeclass="docutils literal notranslate"><spanclass="pre">X</span><spanclass="pre">|</span><spanclass="pre">Y</span><spanclass="pre">|</span><spanclass="pre">None</span></code> over
1240
+
<li><p><strong>Use | for unions</strong>: Prefer <codeclass="docutils literal notranslate"><spanclass="pre">X</span><spanclass="pre">|</span><spanclass="pre">Y</span><spanclass="pre">|</span><spanclass="pre">None</span></code> over
1241
1241
<codeclass="docutils literal notranslate"><spanclass="pre">Union[X,</span><spanclass="pre">Y]</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">Optional[X]</span></code>.</p></li>
1242
-
<li><p><strong>Avoid ``TYPE_CHECKING`` blocks</strong>: With
1242
+
<li><p><strong>Avoid TYPE_CHECKING blocks</strong>: With
1243
1243
<codeclass="docutils literal notranslate"><spanclass="pre">from</span><spanclass="pre">__future__</span><spanclass="pre">import</span><spanclass="pre">annotations</span></code>, forward references work
1244
1244
without <codeclass="docutils literal notranslate"><spanclass="pre">TYPE_CHECKING</span></code> guards.</p></li>
1245
1245
<li><p><strong>Import types normally</strong>: Even if a type is only used in
@@ -1572,8 +1572,8 @@ <h2>Errors and Warnings<a class="headerlink" href="#errors-and-warnings" title="
1572
1572
<h3>CUDA Exceptions<aclass="headerlink" href="#cuda-exceptions" title="Link to this heading">#</a></h3>
1573
1573
<p>The project defines custom exceptions for CUDA-specific errors:</p>
1574
1574
<ulclass="simple">
1575
-
<li><p><strong>``CUDAError``</strong>: Base exception for CUDA driver errors</p></li>
1576
-
<li><p><strong>``NVRTCError``</strong>: Exception for NVRTC compiler errors (inherits from
1575
+
<li><p><strong>CUDAError</strong>: Base exception for CUDA driver errors</p></li>
1576
+
<li><p><strong>NVRTCError</strong>: Exception for NVRTC compiler errors (inherits from
0 commit comments