Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin the version of some dependencies for readthedoc #469

Merged
merged 3 commits into from
Jan 9, 2023
Merged
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
5 changes: 3 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
Sphinx
Sphinx==4.5.0
docutils<0.17
sphinx-rtd-theme>=0.5.2
sphinx-gallery
sphinxcontrib-phpdomain
sphinx-autoapi
Expand All @@ -7,4 +9,3 @@ DoubleML
pyts
dowhy
numpy<1.23
Jinja2<3.1
23 changes: 19 additions & 4 deletions python/abess/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,25 @@
def fix_docs(cls):
# This function is to inherit the docstring from base class
# and avoid unnecessary duplications on description.
index = cls.__doc__.find("Examples\n --------\n")
if index != -1:
cls.__doc__ = cls.__doc__[:index] + \
cls.__bases__[0].__doc__ + cls.__doc__[index:]
title_index = cls.__doc__.find("Parameters\n ----------")
more_para_index = cls.__doc__.find("Examples\n --------")
base_para_index = cls.__bases__[0].__doc__.find(
"Attributes\n ----------")
if title_index == -1:
title_index = 0
if more_para_index == -1:
more_para_index = len(cls.__doc__) - 1
# class title
full_doc = cls.__doc__[:title_index]
# class paras
full_doc = (full_doc +
cls.__bases__[0].__doc__[:base_para_index] +
cls.__doc__[title_index:more_para_index])
# more info
full_doc = (full_doc +
cls.__doc__[more_para_index:] +
cls.__bases__[0].__doc__[base_para_index:])
cls.__doc__ = full_doc
return cls


Expand Down