From 9d94c83b622b53f65055915efba081470f62c1bc Mon Sep 17 00:00:00 2001 From: Niels Bantilan Date: Sun, 21 Apr 2024 01:00:30 -0400 Subject: [PATCH] use sphinx-design directives instead of sphinx-panels (#2364) * update docs to use sphinx design, custom rst template Signed-off-by: cosmicBboy * fix docstring formatting Signed-off-by: cosmicBboy * update autosummary for accelerators Signed-off-by: cosmicBboy --------- Signed-off-by: cosmicBboy --- docs/source/extras.accelerators.rst | 6 +++--- flytekit/configuration/__init__.py | 4 ++-- flytekit/core/base_task.py | 2 ++ flytekit/core/promise.py | 4 +++- flytekit/core/python_function_task.py | 2 ++ flytekit/core/type_engine.py | 1 + flytekit/deck/__init__.py | 2 ++ flytekit/extend/__init__.py | 2 ++ flytekit/extras/accelerators.py | 5 +++++ flytekit/image_spec/__init__.py | 2 ++ flytekit/testing/__init__.py | 1 + flytekit/types/error/__init__.py | 2 ++ flytekit/types/iterator/__init__.py | 3 +++ flytekit/types/pickle/__init__.py | 1 + 14 files changed, 31 insertions(+), 6 deletions(-) diff --git a/docs/source/extras.accelerators.rst b/docs/source/extras.accelerators.rst index 2655200a23..f415b7904b 100644 --- a/docs/source/extras.accelerators.rst +++ b/docs/source/extras.accelerators.rst @@ -1,4 +1,4 @@ .. automodule:: flytekit.extras.accelerators - :members: - :undoc-members: - :show-inheritance: + :no-members: + :no-inherited-members: + :no-special-members: diff --git a/flytekit/configuration/__init__.py b/flytekit/configuration/__init__.py index e013babc7c..5ca5ff07b0 100644 --- a/flytekit/configuration/__init__.py +++ b/flytekit/configuration/__init__.py @@ -35,7 +35,7 @@ ``~/.flyte/config.yaml`` file, and ``flytectl --help`` to learn about all of the configuration yaml options. .. dropdown:: See example ``config.yaml`` file - :title: text-muted + :color: muted :animate: fade-in-slide-down .. literalinclude:: ../../tests/flytekit/unit/configuration/configs/sample.yaml @@ -49,7 +49,7 @@ 2. A file in ``~/.flyte/config`` in the home directory as detected by Python. .. dropdown:: See example ``flytekit.config`` file - :title: text-muted + :color: muted :animate: fade-in-slide-down .. literalinclude:: ../../tests/flytekit/unit/configuration/configs/images.config diff --git a/flytekit/core/base_task.py b/flytekit/core/base_task.py index 7411fd635e..e7c4c44296 100644 --- a/flytekit/core/base_task.py +++ b/flytekit/core/base_task.py @@ -6,6 +6,8 @@ .. currentmodule:: flytekit.core.base_task .. autosummary:: + :nosignatures: + :template: custom.rst :toctree: generated/ kwtypes diff --git a/flytekit/core/promise.py b/flytekit/core/promise.py index 1c11995102..d3af6d1823 100644 --- a/flytekit/core/promise.py +++ b/flytekit/core/promise.py @@ -390,7 +390,9 @@ def with_var(self, new_var: str) -> Promise: def is_ready(self) -> bool: """ Returns if the Promise is READY (is not a reference and the val is actually ready) - Usage: + + Usage :: + p = Promise(...) ... if p.is_ready(): diff --git a/flytekit/core/python_function_task.py b/flytekit/core/python_function_task.py index f97d96296e..f2f354fa27 100644 --- a/flytekit/core/python_function_task.py +++ b/flytekit/core/python_function_task.py @@ -6,6 +6,8 @@ .. currentmodule:: flytekit.core.python_function_task .. autosummary:: + :nosignatures: + :template: custom.rst :toctree: generated/ PythonFunctionTask diff --git a/flytekit/core/type_engine.py b/flytekit/core/type_engine.py index 7f0ddd445a..a5b9bbb5da 100644 --- a/flytekit/core/type_engine.py +++ b/flytekit/core/type_engine.py @@ -957,6 +957,7 @@ def get_transformer(cls, python_type: Type) -> TypeTransformer[T]: d = dictionary of registered transformers, where is a python `type` v = lookup type + Step 1: If the type is annotated with a TypeTransformer instance, use that. diff --git a/flytekit/deck/__init__.py b/flytekit/deck/__init__.py index 610f92da15..5250ad0adc 100644 --- a/flytekit/deck/__init__.py +++ b/flytekit/deck/__init__.py @@ -8,6 +8,8 @@ Contains deck renderers provided by flytekit. .. autosummary:: + :nosignatures: + :template: custom.rst :toctree: generated/ Deck diff --git a/flytekit/extend/__init__.py b/flytekit/extend/__init__.py index 07e92e4c24..73ac51e0ab 100644 --- a/flytekit/extend/__init__.py +++ b/flytekit/extend/__init__.py @@ -8,6 +8,8 @@ This package contains things that are useful when extending Flytekit. .. autosummary:: + :nosignatures: + :template: custom.rst :toctree: generated/ get_serializable diff --git a/flytekit/extras/accelerators.py b/flytekit/extras/accelerators.py index 6f3fac9ffd..139237e1fb 100644 --- a/flytekit/extras/accelerators.py +++ b/flytekit/extras/accelerators.py @@ -31,6 +31,9 @@ def my_task() -> None: .. currentmodule:: flytekit.extras.accelerators .. autosummary:: + :template: custom.rst + :toctree: generated/ + :nosignatures: BaseAccelerator GPUAccelerator @@ -75,6 +78,8 @@ def my_task() -> None: .. currentmodule:: flytekit.extras.accelerators .. autosummary:: + :toctree: generated/ + :nosignatures: A10G L4 diff --git a/flytekit/image_spec/__init__.py b/flytekit/image_spec/__init__.py index 0495487a82..e47f7f159c 100644 --- a/flytekit/image_spec/__init__.py +++ b/flytekit/image_spec/__init__.py @@ -8,6 +8,8 @@ This module contains the ImageSpec class parameters and methods. .. autosummary:: + :nosignatures: + :template: custom.rst :toctree: generated/ ImageSpec diff --git a/flytekit/testing/__init__.py b/flytekit/testing/__init__.py index 06b69612e5..ccb95e6d33 100644 --- a/flytekit/testing/__init__.py +++ b/flytekit/testing/__init__.py @@ -9,6 +9,7 @@ testing workflows that contain tasks that cannot run locally (a Hive task for instance). .. autosummary:: + :template: custom.rst :toctree: generated/ patch - A decorator similar to the regular one you're probably used to diff --git a/flytekit/types/error/__init__.py b/flytekit/types/error/__init__.py index 16ff444e63..6714e88844 100644 --- a/flytekit/types/error/__init__.py +++ b/flytekit/types/error/__init__.py @@ -4,6 +4,8 @@ .. currentmodule:: flytekit.types.error .. autosummary:: + :nosignatures: + :template: custom.rst :toctree: generated/ FlyteError diff --git a/flytekit/types/iterator/__init__.py b/flytekit/types/iterator/__init__.py index 59733b62a0..998a84b422 100644 --- a/flytekit/types/iterator/__init__.py +++ b/flytekit/types/iterator/__init__.py @@ -2,8 +2,11 @@ Flytekit Iterator Type ========================================================== .. currentmodule:: flytekit.types.iterator + .. autosummary:: + :nosignatures: :toctree: generated/ + FlyteIterator """ diff --git a/flytekit/types/pickle/__init__.py b/flytekit/types/pickle/__init__.py index e5bd1c056d..44c16b25cd 100644 --- a/flytekit/types/pickle/__init__.py +++ b/flytekit/types/pickle/__init__.py @@ -4,6 +4,7 @@ .. currentmodule:: flytekit.types.pickle .. autosummary:: + :template: custom.rst :toctree: generated/ FlytePickle