Skip to content
Snippets Groups Projects
Commit 49b57629 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV
Browse files

Better fix of sphinx issue

parent 79508189
No related branches found
No related tags found
1 merge request!50Added nitpicky to sphinx and fixed warnings
Pipeline #
...@@ -5,13 +5,35 @@ from .LDA import LDA ...@@ -5,13 +5,35 @@ from .LDA import LDA
from .PLDA import PLDA from .PLDA import PLDA
from .BIC import BIC from .BIC import BIC
# to fix sphinx warnings of not being able to find classes, when path is shortened # # to fix sphinx warnings of not being able to find classes, when path is shortened
Algorithm.__module__ = "bob.bio.base.algorithm" # Algorithm.__module__ = "bob.bio.base.algorithm"
Distance.__module__ = "bob.bio.base.algorithm" # Distance.__module__ = "bob.bio.base.algorithm"
PCA.__module__ = "bob.bio.base.algorithm" # PCA.__module__ = "bob.bio.base.algorithm"
LDA.__module__ = "bob.bio.base.algorithm" # LDA.__module__ = "bob.bio.base.algorithm"
PLDA.__module__ = "bob.bio.base.algorithm" # PLDA.__module__ = "bob.bio.base.algorithm"
BIC.__module__ = "bob.bio.base.algorithm" # BIC.__module__ = "bob.bio.base.algorithm"
# gets sphinx autodoc done right - don't remove it # gets sphinx autodoc done right - don't remove it
def __appropriate__(*args):
"""Says object was actually declared here, and not in the import module.
Fixing sphinx warnings of not being able to find classes, when path is shortened.
Parameters:
*args: An iterable of objects to modify
Resolves `Sphinx referencing issues
<https://github.com/sphinx-doc/sphinx/issues/3048>`
"""
for obj in args: obj.__module__ = __name__
__appropriate__(
Algorithm,
Distance,
PCA,
LDA,
PLDA,
BIC,
)
__all__ = [_ for _ in dir() if not _.startswith('_')] __all__ = [_ for _ in dir() if not _.startswith('_')]
...@@ -10,4 +10,23 @@ BioDatabase.__module__ = "bob.bio.base.database" ...@@ -10,4 +10,23 @@ BioDatabase.__module__ = "bob.bio.base.database"
ZTBioDatabase.__module__ = "bob.bio.base.database" ZTBioDatabase.__module__ = "bob.bio.base.database"
# gets sphinx autodoc done right - don't remove it # gets sphinx autodoc done right - don't remove it
def __appropriate__(*args):
"""Says object was actually declared here, and not in the import module.
Fixing sphinx warnings of not being able to find classes, when path is shortened.
Parameters:
*args: An iterable of objects to modify
Resolves `Sphinx referencing issues
<https://github.com/sphinx-doc/sphinx/issues/3048>`
"""
for obj in args: obj.__module__ = __name__
__appropriate__(
BioFile,
BioFileSet,
BioDatabase,
ZTBioDatabase,
)
__all__ = [_ for _ in dir() if not _.startswith('_')] __all__ = [_ for _ in dir() if not _.startswith('_')]
...@@ -6,4 +6,21 @@ Extractor.__module__ = "bob.bio.base.extractor" ...@@ -6,4 +6,21 @@ Extractor.__module__ = "bob.bio.base.extractor"
Linearize.__module__ = "bob.bio.base.extractor" Linearize.__module__ = "bob.bio.base.extractor"
# gets sphinx autodoc done right - don't remove it # gets sphinx autodoc done right - don't remove it
def __appropriate__(*args):
"""Says object was actually declared here, and not in the import module.
Fixing sphinx warnings of not being able to find classes, when path is shortened.
Parameters:
*args: An iterable of objects to modify
Resolves `Sphinx referencing issues
<https://github.com/sphinx-doc/sphinx/issues/3048>`
"""
for obj in args: obj.__module__ = __name__
__appropriate__(
Extractor,
Linearize,
)
__all__ = [_ for _ in dir() if not _.startswith('_')] __all__ = [_ for _ in dir() if not _.startswith('_')]
...@@ -6,4 +6,21 @@ Preprocessor.__module__ = "bob.bio.base.preprocessor" ...@@ -6,4 +6,21 @@ Preprocessor.__module__ = "bob.bio.base.preprocessor"
Filename.__module__ = "bob.bio.base.preprocessor" Filename.__module__ = "bob.bio.base.preprocessor"
# gets sphinx autodoc done right - don't remove it # gets sphinx autodoc done right - don't remove it
def __appropriate__(*args):
"""Says object was actually declared here, and not in the import module.
Fixing sphinx warnings of not being able to find classes, when path is shortened.
Parameters:
*args: An iterable of objects to modify
Resolves `Sphinx referencing issues
<https://github.com/sphinx-doc/sphinx/issues/3048>`
"""
for obj in args: obj.__module__ = __name__
__appropriate__(
Preprocessor,
Filename,
)
__all__ = [_ for _ in dir() if not _.startswith('_')] __all__ = [_ for _ in dir() if not _.startswith('_')]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment