From e7df3a466d898629e0fd40506700417c8b2f100b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yolan=20Honor=C3=A9-Roug=C3=A9?= Date: Mon, 2 May 2022 23:30:26 +0200 Subject: [PATCH] :bug: :memo: Fix wrong documentation building with myst_parser (#6) --- docs/conf.py | 17 ++++------------- .../source/03_getting_started/02_first_steps.md | 2 +- docs/source/05_framework_ml/index.rst | 1 - docs/source/05_pipeline_serving/index.rst | 4 ++-- docs/source/07_python_objects/02_Hooks.md | 4 ++-- docs/source/07_python_objects/04_CLI.md | 2 +- kedro_mlflow/mlflow/kedro_pipeline_model.py | 2 -- setup.py | 11 +++++------ 8 files changed, 15 insertions(+), 28 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2b8bd177..cdb3ec61 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,6 +46,7 @@ # "nbsphinx", "sphinx_copybutton", "sphinx_markdown_tables", + "myst_parser", ] # enable autosummary plugin (table of contents for modules/classes/class @@ -55,19 +56,13 @@ napoleon_include_init_with_doc = True # enable documentation in markdown -source_suffix = { - ".rst": "restructuredtext", - ".txt": "markdown", - ".md": "markdown", -} +source_suffix = {".rst": "restructuredtext", ".md": "markdown"} -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] +exclude_patterns = ["_build"] # -- Options for HTML output ------------------------------------------------- @@ -79,13 +74,9 @@ # html_theme = "sphinx_rtd_theme" -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - # useful to create dropdown with the name of the directory as the section name # see https://stackoverflow.com/questions/36925871/toctree-nested-drop-down: html_theme_options = {"collapse_navigation": False} + myst_heading_anchors = 5 diff --git a/docs/source/03_getting_started/02_first_steps.md b/docs/source/03_getting_started/02_first_steps.md index a324d60b..5d3e6867 100644 --- a/docs/source/03_getting_started/02_first_steps.md +++ b/docs/source/03_getting_started/02_first_steps.md @@ -99,7 +99,7 @@ kedro viz Open your browser at the following adress: -```browser +```{browser} http://localhost:4141/ ``` diff --git a/docs/source/05_framework_ml/index.rst b/docs/source/05_framework_ml/index.rst index 1b8a42c5..86ef1314 100644 --- a/docs/source/05_framework_ml/index.rst +++ b/docs/source/05_framework_ml/index.rst @@ -7,4 +7,3 @@ Introduction Why we need a mlops framework for development lifecycle <01_why_framework.md> The architecture of a machine learning project <02_ml_project_components.md> An efficient tool for model serving and training / inference synchronization <03_framework_solutions.md> - A step by step example <04_example_project.md> diff --git a/docs/source/05_pipeline_serving/index.rst b/docs/source/05_pipeline_serving/index.rst index b2182a7d..0b30c877 100644 --- a/docs/source/05_pipeline_serving/index.rst +++ b/docs/source/05_pipeline_serving/index.rst @@ -4,8 +4,8 @@ Introduction .. toctree:: :maxdepth: 4 - Reminder on Mlflow Models <01_mlflow_model.md> + Reminder on Mlflow Models <01_mlflow_models.md> Log a Pipeline as model with ``KedroPipelineModel`` <02_custom_kedro_pipeline_model.md> Log a Pipeline as model with the CLI <03_cli_modelify.md> Automatically log inference pipeline after training <04_hook_pipeline_ml.md> - Deployments patterns for ``KedroPipelineModel`` models <05_deployments_patterns.md> + Deployments patterns for ``KedroPipelineModel`` models <05_deployment_patterns.md> diff --git a/docs/source/07_python_objects/02_Hooks.md b/docs/source/07_python_objects/02_Hooks.md index d3d90a9e..8b894c66 100644 --- a/docs/source/07_python_objects/02_Hooks.md +++ b/docs/source/07_python_objects/02_Hooks.md @@ -7,8 +7,8 @@ This package provides 2 new hooks. This hook : 1. manages mlflow settings at the beginning and the end of the run (run start / end). - 2. log useful informations for reproducibility as ``mlflow tags`` (including kedro ``Journal`` information and the commands used to launch the run). - 3. register the pipeline as a valid ``mlflow model`` if [it is a ``PipelineML`` instance](#new-pipeline) + 2. log useful informations for reproducibility as ``mlflow tags`` (including kedro ``Journal`` information for old kedro versions and the commands used to launch the run). + 3. register the pipeline as a valid ``mlflow model`` if [it is a ``PipelineML`` instance](./03_Pipelines.md) ## ``MlflowNodeHook`` diff --git a/docs/source/07_python_objects/04_CLI.md b/docs/source/07_python_objects/04_CLI.md index 26173cc5..3a771852 100644 --- a/docs/source/07_python_objects/04_CLI.md +++ b/docs/source/07_python_objects/04_CLI.md @@ -4,7 +4,7 @@ ``kedro mlflow init``: this command is needed to initalize your project. You cannot run any other commands before you run this one once. It performs 2 actions: - creates a ``mlflow.yml`` configuration file in your ``conf/local`` folder - - replace the ``src/PYTHON_PACKAGE/run.py`` file by an updated version of the template. If your template has been modified since project creation, a warning will be raised. You can either run ``kedro mlflow init --force`` to ignore this warning (but this will erase your ``run.py``) or [set hooks manually](#new-hooks). + - replace the ``src/PYTHON_PACKAGE/run.py`` file by an updated version of the template. If your template has been modified since project creation, a warning will be raised. You can either run ``kedro mlflow init --force`` to ignore this warning (but this will erase your ``run.py``) or [set hooks manually](../02_installation/02_setup.md#declaring-kedro-mlflow-hooks). `init` has two arguments: diff --git a/kedro_mlflow/mlflow/kedro_pipeline_model.py b/kedro_mlflow/mlflow/kedro_pipeline_model.py index 65011f24..00190212 100644 --- a/kedro_mlflow/mlflow/kedro_pipeline_model.py +++ b/kedro_mlflow/mlflow/kedro_pipeline_model.py @@ -208,8 +208,6 @@ def load_context(self, context): self.loaded_catalog.save(name=name, data=updated_catalog.load(name)) def predict(self, context, model_input): - # TODO : checkout out how to pass extra args in predict - # for instance, to enable parallelization # we create an empty hook manager but do NOT register hooks # because we want this model be executable outside of a kedro project diff --git a/setup.py b/setup.py index 490068c6..f773ffd2 100644 --- a/setup.py +++ b/setup.py @@ -39,12 +39,11 @@ def _parse_requirements(path, encoding="utf-8"): extras_require={ "doc": [ "sphinx>=4.5.0,<5.0.0", - "sphinx_rtd_theme==1.0.0", - "sphinx-markdown-tables==0.0.15", - "sphinx-click==3.1.0", - "sphinx_copybutton==0.5.0", - "pandas>=1.0.0, <2.0.0", # avoid to make readthedocs load rc version - "numpy>=1.0.0, <2.0.0", # bug on windows for numpy 1.19.0->1.19.4 + "sphinx_rtd_theme~=1.0.0", + "sphinx-markdown-tables~=0.0.15", + "sphinx-click~=3.1.0", + "sphinx_copybutton~=0.5.0", + "myst-parser~=0.17.2", ], "test": [ "pytest>=5.4.0, <8.0.0",