Skip to content

Commit

Permalink
Merge pull request #469 from oooo26/master
Browse files Browse the repository at this point in the history
Pin the version of some dependencies for readthedoc
  • Loading branch information
oooo26 authored Jan 9, 2023
2 parents 6cb6aef + 928364f commit db62b47
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
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

0 comments on commit db62b47

Please sign in to comment.