Skip to content

Commit b9d8665

Browse files
committed
add module comments and refactor api docs
1 parent 497a68f commit b9d8665

25 files changed

Lines changed: 169 additions & 6 deletions

File tree

docs/source/_templates/autosummary/module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.. rubric:: Description
44

55
.. automodule:: {{ fullname }}
6-
6+
77
{% block functions %}
88
{% if functions %}
99
.. rubric:: Functions
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
{% set pasteur_attr = ["pasteur.attribute","pasteur.hierarchy","pasteur.table"] %}
46+
{% set pasteur_modules = ["pasteur.module", "pasteur.dataset","pasteur.view","pasteur.transform","pasteur.encode","pasteur.synth","pasteur.metric"] %}
47+
{% set pasteur_misc = ["pasteur.kedro","pasteur.utils","pasteur.extras","pasteur.cli"] %}
48+
49+
.. rubric:: Module-System Modules
50+
51+
.. autosummary::
52+
:toctree:
53+
:template: autosummary/module.rst
54+
:recursive:
55+
{% for item in pasteur_modules %}
56+
{{ item }}
57+
{%- endfor %}
58+
59+
.. rubric:: Transformation-Related Modules
60+
61+
.. autosummary::
62+
:toctree:
63+
:template: autosummary/module.rst
64+
:recursive:
65+
{% for item in pasteur_attr %}
66+
{{ item }}
67+
{%- endfor %}
68+
69+
{% block modules %}
70+
{% if modules|length > pasteur_modules|length + pasteur_misc|length + pasteur_attr|length %}
71+
.. rubric:: Other Modules
72+
73+
.. autosummary::
74+
:toctree:
75+
:template: autosummary/module.rst
76+
:recursive:
77+
{% for item in modules %}
78+
{% if item not in pasteur_modules and item not in pasteur_attr and item not in pasteur_misc %}
79+
{{ item }}
80+
{% endif %}
81+
{%- endfor %}
82+
{% endif %}
83+
{% endblock %}
84+
85+
.. rubric:: Miscellaneous Modules
86+
87+
.. autosummary::
88+
:toctree:
89+
:template: autosummary/module.rst
90+
:recursive:
91+
{% for item in pasteur_misc %}
92+
{{ item }}
93+
{%- endfor %}

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ API documentation
2222
.. autosummary::
2323
:toctree: api
2424
:caption: API documentation
25-
:template: autosummary/module.rst
25+
:template: autosummary/pasteur.rst
2626
:recursive:
2727

2828
pasteur

src/pasteur/encode.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
""" Provides the base definition for Encoder modules"""
2+
13
import pandas as pd
24

35
from .attribute import Attribute

src/pasteur/extras/metrics/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
""" This module provides Model based metrics.
2+
3+
Currently, this translates to classifiers. """
4+
15
from __future__ import annotations
26

37
from .base import BaseModel, ModelMetric

src/pasteur/kedro/__init__.py

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

src/pasteur/kedro/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
""" In this module, all Pasteur related cli commands are defined.
2+
3+
You can access them through `pasteur <command>` or `kedro <command>`. """
4+
15
import logging
26
from typing import Any, Iterable
37

src/pasteur/kedro/dataset.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
""" This module provides kedro datasets that have been customized to suit Pasteur's needs.
2+
3+
The most notable additions are that the datasets lazy load data through `PartitionedDataset`
4+
and can partition save data through custom `Node` return types. """
5+
16
import logging
27
import os
38
import re

src/pasteur/kedro/hooks/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
""" Pasteur ships with two hooks: one that dynamically creates the synthetic
2+
data pipelines and datasets, and one that manages Mlflow runs.
3+
4+
The classes of those hooks are provided through `PasteurHook`, `MlflowTrackingHook`.
5+
6+
In addition, instances of those hooks are provided in `pasteur` and `mlflow`,
7+
which are registered as Kedro entrypoints. """
8+
19
from ..utils import get_pasteur_modules
210

311
modules = get_pasteur_modules()

src/pasteur/kedro/ipython.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
""" This module extends Kedro's ipython functionality. """
12
from pathlib import Path
23

34
from IPython import get_ipython

0 commit comments

Comments
 (0)