From 099510d6c01ef20274b9c4bbe6b33de04f65f365 Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 31 Jan 2024 18:11:34 +0000 Subject: [PATCH] configure and initialize mkdocstrings --- docs/reference/SUMMARY.md | 12 +++++++++ docs/reference/fluxion/adapters.md | 1 + docs/reference/fluxion/context.md | 1 + docs/reference/fluxion/layers.md | 1 + docs/reference/fluxion/model_converter.md | 1 + docs/reference/fluxion/utils.md | 1 + docs/reference/foundationals/clip.md | 1 + docs/reference/foundationals/dinov2.md | 1 + .../foundationals/latent_diffusion.md | 1 + .../foundationals/segment_anything.md | 1 + mkdocs.yml | 27 ++++++++++++++++--- pyproject.toml | 8 ++++-- 12 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 docs/reference/SUMMARY.md create mode 100644 docs/reference/fluxion/adapters.md create mode 100644 docs/reference/fluxion/context.md create mode 100644 docs/reference/fluxion/layers.md create mode 100644 docs/reference/fluxion/model_converter.md create mode 100644 docs/reference/fluxion/utils.md create mode 100644 docs/reference/foundationals/clip.md create mode 100644 docs/reference/foundationals/dinov2.md create mode 100644 docs/reference/foundationals/latent_diffusion.md create mode 100644 docs/reference/foundationals/segment_anything.md diff --git a/docs/reference/SUMMARY.md b/docs/reference/SUMMARY.md new file mode 100644 index 0000000..9a31bb8 --- /dev/null +++ b/docs/reference/SUMMARY.md @@ -0,0 +1,12 @@ +* Fluxion + * [ Adapters](fluxion/adapters.md) + * [ Context](fluxion/context.md) + * [ Layers](fluxion/layers.md) + * [ Model Converter](fluxion/model_converter.md) + * [ Utils](fluxion/utils.md) +* Foundationals Models + * [ CLIP](foundationals/clip.md) + * [ DINOv2](foundationals/dinov2.md) + * [ Latent Diffusion](foundationals/latent_diffusion.md) + * [ Segment Anything](foundationals/segment_anything.md) + diff --git a/docs/reference/fluxion/adapters.md b/docs/reference/fluxion/adapters.md new file mode 100644 index 0000000..e53f493 --- /dev/null +++ b/docs/reference/fluxion/adapters.md @@ -0,0 +1 @@ +::: refiners.fluxion.adapters diff --git a/docs/reference/fluxion/context.md b/docs/reference/fluxion/context.md new file mode 100644 index 0000000..c384de4 --- /dev/null +++ b/docs/reference/fluxion/context.md @@ -0,0 +1 @@ +::: refiners.fluxion.context diff --git a/docs/reference/fluxion/layers.md b/docs/reference/fluxion/layers.md new file mode 100644 index 0000000..d1022bd --- /dev/null +++ b/docs/reference/fluxion/layers.md @@ -0,0 +1 @@ +::: refiners.fluxion.layers diff --git a/docs/reference/fluxion/model_converter.md b/docs/reference/fluxion/model_converter.md new file mode 100644 index 0000000..39f4988 --- /dev/null +++ b/docs/reference/fluxion/model_converter.md @@ -0,0 +1 @@ +::: refiners.fluxion.model_converter diff --git a/docs/reference/fluxion/utils.md b/docs/reference/fluxion/utils.md new file mode 100644 index 0000000..061ce6c --- /dev/null +++ b/docs/reference/fluxion/utils.md @@ -0,0 +1 @@ +::: refiners.fluxion.utils \ No newline at end of file diff --git a/docs/reference/foundationals/clip.md b/docs/reference/foundationals/clip.md new file mode 100644 index 0000000..758a7bb --- /dev/null +++ b/docs/reference/foundationals/clip.md @@ -0,0 +1 @@ +::: refiners.foundationals.clip diff --git a/docs/reference/foundationals/dinov2.md b/docs/reference/foundationals/dinov2.md new file mode 100644 index 0000000..699de76 --- /dev/null +++ b/docs/reference/foundationals/dinov2.md @@ -0,0 +1 @@ +::: refiners.foundationals.dinov2 diff --git a/docs/reference/foundationals/latent_diffusion.md b/docs/reference/foundationals/latent_diffusion.md new file mode 100644 index 0000000..bb0c84a --- /dev/null +++ b/docs/reference/foundationals/latent_diffusion.md @@ -0,0 +1 @@ +::: refiners.foundationals.latent_diffusion diff --git a/docs/reference/foundationals/segment_anything.md b/docs/reference/foundationals/segment_anything.md new file mode 100644 index 0000000..88b342c --- /dev/null +++ b/docs/reference/foundationals/segment_anything.md @@ -0,0 +1 @@ +::: refiners.foundationals.segment_anything diff --git a/mkdocs.yml b/mkdocs.yml index f3dcee8..91a8bcd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -19,13 +19,34 @@ theme: - navigation.expand - navigation.path - toc.follow - - toc.integrate - navigation.tabs.sticky - content.code.copy plugins: - - mkdocstrings - search - tags + - literate-nav: + nav_file: SUMMARY.md + - mkdocstrings: + handlers: + python: + import: + - https://docs.python.org/3/objects.inv + - https://pytorch.org/docs/master/objects.inv + options: + show_bases: true + show_source: true + show_root_toc_entry: false + show_symbol_type_heading: true + show_symbol_type_toc: true + show_if_no_docstring: false + filters: + - "!^_" + docstring_options: + ignore_init_summary: true + merge_init_into_class: true + separate_signature: true + show_signature_annotations: true + signature_crossrefs: true extra_css: - stylesheets/extra.css nav: @@ -39,7 +60,7 @@ nav: - concepts/index.md - concepts/adapters.md - API Reference: - - index.md + - Refiners: reference/ extra: social: - icon: fontawesome/brands/discord diff --git a/pyproject.toml b/pyproject.toml index 5c3f209..49e7a18 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,9 +55,10 @@ dev-dependencies = [ "ruff>=0.1.15", "docformatter>=1.7.5", "pytest>=8.0.0", - "mkdocs-material>=9.5.6", "coverage>=7.4.1", + "mkdocs-material>=9.5.6", "mkdocstrings[python]>=0.24.0", + "mkdocs-literate-nav>=0.6.1", ] @@ -71,7 +72,10 @@ test-cov = "coverage run -m pytest" # Work around for "Couldn't parse" errors due to e.g. opencv-python: # https://github.com/nedbat/coveragepy/issues/1653 build-html-cov = { cmd = "coverage html", env = { PYTHONWARNINGS = "ignore:Couldn't parse::coverage.report_core" } } -serve-cov-report = { chain = ["build-html-cov", "python -m http.server 8080 -b 127.0.0.1 -d htmlcov"]} +serve-cov-report = { chain = [ + "build-html-cov", + "python -m http.server 8080 -b 127.0.0.1 -d htmlcov", +] } [tool.black] line-length = 120