Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion mkdocstrings_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# Suppress griffe warnings
logging.getLogger("griffe").setLevel(logging.ERROR)


class MkDocstringsParser:
def __init__(self):
pass
Expand Down Expand Up @@ -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

Expand Down
18 changes: 10 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
2 changes: 1 addition & 1 deletion tests/test_hierarchicalforecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,4 @@ def test_bottomup(setup_parser):
---- | ---- | -----------
`y_tilde` | <code>[dict](#dict)</code> | Reconciliated y_hat using the Bottom Up approach.

"""
"""
Loading