Skip to content

Commit

Permalink
Merge pull request #150 from catalystneuro/try_fix_147
Browse files Browse the repository at this point in the history
Trying to fix API doc signatures
  • Loading branch information
CodyCBakerPhD committed Sep 9, 2022
2 parents 5081c18 + feaa3ac commit 1c6067e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 13 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import sys
import inspect
from pathlib import Path

sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
Expand All @@ -10,7 +11,7 @@
extensions = [
"sphinx.ext.napoleon", # Support for NumPy and Google style docstrings
"sphinx.ext.autodoc", # Includes documentation from docstrings in docs/api
"sphinx.ext.autosummary", # To-add
"sphinx.ext.autosummary", # To-add
"sphinx_toggleprompt", # Used to control >>> behavior in the conversion gallery example doctests
"sphinx_copybutton", # Used to control the copy button behavior in the conversion gallery doctsts
"sphinx.ext.intersphinx", # Allows links to other sphinx project documentation sites
Expand Down Expand Up @@ -62,6 +63,17 @@
}
add_module_names = False


def _correct_signatures(app, what, name, obj, options, signature, return_annotation):
if what == "class":
signature = str(inspect.signature(obj.__init__)).replace("self, ", "")
return (signature, return_annotation)


def setup(app):
app.connect("autodoc-process-signature", _correct_signatures)


# Toggleprompt
toggleprompt_offset_right = 45 # This controls the position of the prompt (>>>) for the conversion gallery
toggleprompt_default_hidden = "true"
Expand Down
4 changes: 1 addition & 3 deletions src/neuroconv/datainterfaces/ecephys/ced/ceddatainterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ def _test_sonpy_installation() -> None:
get_package(package_name="sonpy", excluded_platforms_and_python_versions=dict(darwin=["3.7"]))


class CEDRecordingInterface(
BaseRecordingExtractorInterface,
):
class CEDRecordingInterface(BaseRecordingExtractorInterface):
"""Primary data interface class for converting data from CED (Cambridge Electronic Design)."""

ExtractorName = "CedRecordingExtractor"
Expand Down

0 comments on commit 1c6067e

Please sign in to comment.