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

Added sphinx sphinx-autodoc-typehints #2811

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions doc/developer_guide/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest',
'sphinx.ext.intersphinx', 'sphinx.ext.coverage',
'sphinx.ext.imgmath', 'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
'sphinxcontrib.bibtex', 'apilinks']
bibtex_bibfiles = ['../bibliography/references.bib']

Expand Down
1 change: 1 addition & 0 deletions doc/psyad/user_guide/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
# ones. The definition of 'apilinks' is in PSyclone/doc/_ext/apilinks.py.
extensions = [
'sphinx.ext.imgmath', 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx',
'sphinx_autodoc_typehints',
'apilinks']


Expand Down
1 change: 1 addition & 0 deletions doc/reference_guide/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
'sphinx.ext.githubpages',
'sphinx.ext.autodoc',
'sphinx.ext.inheritance_diagram',
'sphinx_autodoc_typehints',
'autoapi.sphinx'
]

Expand Down
1 change: 1 addition & 0 deletions doc/user_guide/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
'sphinx.ext.intersphinx', 'sphinx.ext.coverage',
'sphinx.ext.imgmath', 'sphinx.ext.viewcode',
'sphinxcontrib.bibtex', 'sphinx_tabs.tabs',
'sphinx_autodoc_typehints',
'apilinks',
]
bibtex_bibfiles = ['../bibliography/references.bib']
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def get_files(directory, install_path, valid_suffixes):
'graphviz'],
extras_require={
'doc': ["sphinx", "sphinxcontrib.bibtex", "sphinx-tabs",
"sphinx_rtd_theme", "autoapi"],
"sphinx_rtd_theme", "sphinx-autodoc-typehints", "autoapi"],
'test': ["flake8", "pylint", "pytest-cov", "pytest-xdist"],
},
include_package_data=True,
Expand Down
14 changes: 6 additions & 8 deletions src/psyclone/psyir/nodes/call.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,18 +245,16 @@ def insert_named_arg(self, name, arg, index):
# because the 1st child is the routine reference
self.children.insert(index + 1, arg)

def replace_named_arg(self, existing_name, arg):
def replace_named_arg(self, existing_name: str, arg: DataNode):
'''Replace one named argument node with another node keeping the
same name.

:param str existing_name: the argument name.
:param arg: the argument expression.
:type arg: :py:class:`psyclone.psyir.nodes.DataNode`
:param existing_name: the argument name.
arporter marked this conversation as resolved.
Show resolved Hide resolved
:param arg: the argument expression.

:raises TypeError: if the name argument is the wrong type.
:raises ValueError: if the name argument is already used \
for an existing argument.
:raises TypeError: if the index argument is the wrong type.
:raises TypeError: if the name argument is the wrong type.
:raises ValueError: if the name argument is already used
for an existing argument.

'''
if not isinstance(existing_name, str):
Expand Down
Loading