Skip to content

Commit

Permalink
add api ref
Browse files Browse the repository at this point in the history
  • Loading branch information
EmanuelSommer committed Apr 9, 2024
1 parent c9a501e commit 711552f
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 19 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: documentation

on: [push, pull_request, workflow_dispatch]

permissions:
contents: write

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme myst_parser
- name: Sphinx build
run: |
sphinx-build doc _build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _build/
force_orphan: true
36 changes: 36 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
# API reference

## Data

```{eval-rst}
.. automodule:: src.data
:members:
:undoc-members:
:show-inheritance:
```

## Models

```{eval-rst}
.. automodule:: src.model
:members:
:undoc-members:
:show-inheritance:
```

## Config

```{eval-rst}
.. automodule:: src.config
:members:
:undoc-members:
:show-inheritance:
```

## Utils

```{eval-rst}
.. automodule:: src.utils
:members:
:undoc-members:
:show-inheritance:
```
10 changes: 0 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,4 @@
html_static_path = ['_static']

# autodoc
# autosummary_generate = True
autodoc_typehints = 'description'
autodoc_default_options = {
'members': True,
'member-order': 'bysource',
'special-members': True,
'undoc-members': True,
'exclude-members': '__weakref__',
'show-inheritance': True,
}
# autodoc_mock_imports = ["src"]
18 changes: 9 additions & 9 deletions src/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,13 @@ class PolynomialRegressionModel(LinearRegressionModel):
A polynomial regression model that extends the LinearRegressionModel class.
Parameters:
:param degree (int): The degree of the polynomial regression model. Must be greater
than 0.
:param degree: The degree of the polynomial regression model. Must be greater
than 0.
:type degree: int
Methods:
:return _modify_input(x: NDArray[Shape['*, *'], Float]) ->
NDArray[Shape['*, *'], Float]:
Modifies the input features by transforming them into polynomial features.
_modify_input: Modifies the input features by transforming them into polynomial
features.
"""

def __init__(self, degree: int = 3, *args, **kwargs):
Expand All @@ -215,11 +214,12 @@ def _modify_input(
Modifiy the input features by transforming them into polynomial features.
Parameters:
:param x (NDArray[Shape['*, *'], Float]): The input features.
:param x: The input features.
:type x: NDArray[Shape['*, *'], Float]
Returns:
:return NDArray[Shape['*, *'], Float]: The transformed input features.
:return x_transformed: The transformed input features.
:rtype: NDArray[Shape['*, *'], Float]
"""
transformed_features = []

Expand Down

0 comments on commit 711552f

Please sign in to comment.