diff --git a/mkdocstrings_parser/parser.py b/mkdocstrings_parser/parser.py index fb91c7b..975a938 100644 --- a/mkdocstrings_parser/parser.py +++ b/mkdocstrings_parser/parser.py @@ -10,7 +10,6 @@ # Suppress griffe warnings logging.getLogger("griffe").setLevel(logging.ERROR) - class MkDocstringsParser: def __init__(self): pass @@ -136,6 +135,18 @@ def generate_documentation(self, module_path: str, options: Dict[str, Any]) -> s markdown_docs = render_object_docs(obj, config) # type: ignore markdown_docs = markdown_docs.replace(f"### `{to_replace}.", "### `") + # Fix double backslashes in inline math equations + markdown_docs = re.sub( + r"\$([^$]+)\$", + lambda m: "$" + m.group(1).replace("\\\\", "\\") + "$", + markdown_docs + ) + # Fix underscores in inline math equations + markdown_docs = re.sub( + r"\$([^$]+)\$", + lambda m: "$" + m.group(1).replace("\_", "_") + "$", + markdown_docs + ) return markdown_docs diff --git a/pyproject.toml b/pyproject.toml index af74471..630ad51 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,16 +19,18 @@ dependencies = [ dev = [ "pytest", "pytest-cov", + "lightgbm<4.6" ] nixtlaverse = [ - "coreforecast", - "utilsforecast", - "datasetsforecast", - "mlforecast", - "hierarchicalforecast", - "neuralforecast", - "statsforecast", - "nixtla" + "coreforecast@git+https://github.com/Nixtla/coreforecast.git", + "utilsforecast@git+https://github.com/Nixtla/utilsforecast.git", + "datasetsforecast@git+https://github.com/Nixtla/datasetsforecast.git", + "mlforecast[dask]@git+https://github.com/Nixtla/mlforecast.git", + "mlforecast@git+https://github.com/Nixtla/mlforecast.git", + "hierarchicalforecast@git+https://github.com/Nixtla/hierarchicalforecast.git@fix/docs", + "neuralforecast@git+https://github.com/Nixtla/neuralforecast.git", + "statsforecast@git+https://github.com/Nixtla/statsforecast.git", + "nixtla@git+https://github.com/Nixtla/nixtla.git" ] optional = ["pandas"] diff --git a/tests/test_hierarchicalforecast.py b/tests/test_hierarchicalforecast.py index 9ef1a9e..9a21a1e 100644 --- a/tests/test_hierarchicalforecast.py +++ b/tests/test_hierarchicalforecast.py @@ -240,4 +240,4 @@ def test_bottomup(setup_parser): ---- | ---- | ----------- `y_tilde` | [dict](#dict) | Reconciliated y_hat using the Bottom Up approach. -""" \ No newline at end of file +"""