Skip to content

Commit 497a68f

Browse files
committed
fix api docs
1 parent 9144c5e commit 497a68f

11 files changed

Lines changed: 104 additions & 7 deletions

File tree

docs/source/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
packages
1+
api
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{ fullname | escape | underline}}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. auto{{ objtype }}:: {{ objname }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{ fullname | escape | underline }}
2+
3+
.. currentmodule:: {{ module }}
4+
5+
.. autoclass:: {{ objname }}
6+
:members:
7+
:undoc-members:
8+
:inherited-members:
9+
10+
{% block attributes %}
11+
{% if attributes %}
12+
.. rubric:: Attributes
13+
14+
.. autosummary::
15+
{% for item in attributes %}
16+
~{{ name }}.{{ item }}
17+
{%- endfor %}
18+
{% endif %}
19+
{% endblock %}
20+
21+
{% block methods %}
22+
{% if methods %}
23+
.. rubric:: Methods
24+
25+
.. autosummary::
26+
{% for item in all_methods %}
27+
{%- if not item.startswith('_') %}
28+
~{{ name }}.{{ item }}
29+
{%- endif -%}
30+
{%- endfor %}
31+
{% endif %}
32+
{% endblock %}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{{ fullname | escape | underline }}
2+
3+
.. rubric:: Description
4+
5+
.. automodule:: {{ fullname }}
6+
7+
{% block functions %}
8+
{% if functions %}
9+
.. rubric:: Functions
10+
11+
.. autosummary::
12+
:toctree:
13+
{% for item in functions %}
14+
{{ item }}
15+
{%- endfor %}
16+
{% endif %}
17+
{% endblock %}
18+
19+
{% block classes %}
20+
{% if classes %}
21+
.. rubric:: Classes
22+
23+
.. autosummary::
24+
:toctree:
25+
:template: autosummary/class.rst
26+
{% for item in classes %}
27+
{{ item }}
28+
{%- endfor %}
29+
{% endif %}
30+
{% endblock %}
31+
32+
{% block exceptions %}
33+
{% if exceptions %}
34+
.. rubric:: Exceptions
35+
36+
.. autosummary::
37+
:toctree:
38+
:template: autosummary/class.rst
39+
{% for item in exceptions %}
40+
{{ item }}
41+
{%- endfor %}
42+
{% endif %}
43+
{% endblock %}
44+
45+
{% block modules %}
46+
{% if modules %}
47+
.. rubric:: Modules
48+
49+
.. autosummary::
50+
:toctree:
51+
:template: autosummary/module.rst
52+
:recursive:
53+
{% for item in modules %}
54+
{{ item }}
55+
{%- endfor %}
56+
{% endif %}
57+
{% endblock %}

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
# enable autosummary plugin (table of contents for modules/classes/class
6969
# methods)
7070
autosummary_generate = True
71-
autosummary_generate_overwrite = False
71+
autosummary_generate_overwrite = True
7272
napoleon_include_init_with_doc = True
7373

7474
# Add any paths that contain templates here, relative to this directory.

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ API documentation
2020
=================
2121

2222
.. autosummary::
23-
:toctree: packages
23+
:toctree: api
2424
:caption: API documentation
2525
:template: autosummary/module.rst
2626
:recursive:

src/pasteur/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
""" Provides the `cli` entrypoint for kedro. """
2+
13
# from .kedro.utils import get_pasteur_modules
24

35
# if get_pasteur_modules():

src/pasteur/encode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class Encoder(ModuleClass):
2424
It is up to the encoder to filter it prior to processing. `data` should
2525
not be mutated."""
2626

27-
name: str
28-
attr: Attribute
27+
name: str = ""
28+
attr: Attribute = Attribute("", {})
2929
_factory = EncoderFactory
3030

3131
def fit(self, attr: Attribute, data: pd.DataFrame | None) -> Attribute:

src/pasteur/kedro/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
""" This sub-package contains all kedro-related logic. """

src/pasteur/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Module:
1818
and there can be multiple visualizations for a certain column type.
1919
"""
2020

21-
name: str
21+
name: str = ""
2222

2323

2424
class ModuleClass:

0 commit comments

Comments
 (0)