Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
7 changes: 6 additions & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme myst_parser
# autodoc importiert den Code, um die Docstrings zu lesen.
# Ohne diese Zeile schlaegt der Import fehl und die Seiten bleiben leer.
# torch/pykeops werden via autodoc_mock_imports in conf.py simuliert.
pip install -e .
- name: Sphinx build
run: |
cd docs
sphinx-apidoc -o ./source ../src -f
make html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
115 changes: 9 additions & 106 deletions docs/source/GC.rst
Original file line number Diff line number Diff line change
@@ -1,106 +1,9 @@
GroupedCoefficients
=======================

.. py:class:: GC(settings, data)

Superclass of GroupedCoefficientsComplex and GroupedCoefficientsReal.
A class to hold coefficients belonging to indices in a grouped index set.

.. rubric:: Attributes:

.. py:attribute:: settings

List of setting objects (see bellow) - uniquely describes the setting such as the bandlimits

.. py:attribute:: data

Numpy array of dtype float or dtype complex - the vector of coefficients

.. rubric:: Constructor:

.. py:method:: GroupedCoefficients( setting, data = nothing )


.. rubric:: Functions:

.. py:method:: __getitem__(idx)

If `idx` is a tuple that contains integer,
this function overloads getitem of GC such that you can do ``fhat[(1,3)]`` to obtain the basis coefficients of the corresponding ANOVA term defined by `u`.

If `idx` is an integer,
this function overloads getitem of GC such that you can do ``fhat[1]`` to obtain the basis coefficient determined by `idx`.

.. py:method:: __setitem__(idx, Number)

If `idx` is a tuple that contains integer,
this function overloads setitem of GC such that you can do ``fhat[(1,3)] = [1 2 3]``.

If `idx` is an integer,
this function overloads setitem of GC such that you can do ``fhat[1] = 3``.

.. py:method:: vec()

This function returns the vector of the basis coefficients of `self`.

.. py:method:: __rmul__(alpha)

This function defines multiplication of a number with a GC object.

.. py:method:: __add__(other)

This function defines the addition of two GC objects.

.. py:method:: __sub__(other)

This function defines the subtraction of two GC objects.

.. py:method:: set_data(data)

With this function one can set the data of a GC object.


.. py:function:: variances(j, m)

matrix of variances between two basis functions, needed for wavelet basis, since they are not orthonormal.


.. py:class:: GroupedCoefficientsComplex(GC)

A class to hold complex coefficients belonging to indices in a grouped index set.

.. rubric:: Constructor:

.. py:method:: GroupedCoefficientsComplex( setting, data = nothing )


.. py:class:: GroupedCoefficientsReal(GC)

A class to hold real coefficients belonging to indices in a grouped index set.

.. rubric:: Constructor:

.. py:method:: GroupedCoefficientsReal( setting, data = nothing )


.. py:class:: Setting

.. rubric:: Attributes:

.. py:attribute:: u

tuple of ints

.. py:attribute:: mode

string

.. py:attribute:: bandwidths

numpy array of dtype "int32"


.. py:attribute:: basis_vect

list of strings

GroupedCoefficients
===================

.. automodule:: pyGroupedTransforms.GroupedCoefficients
:members:
:undoc-members:
:show-inheritance:
:member-order: alphabetical
:special-members: __getitem__, __setitem__, __add__, __sub__, __rmul__
75 changes: 16 additions & 59 deletions docs/source/GroupedTransforms.rst
Original file line number Diff line number Diff line change
@@ -1,59 +1,16 @@
GroupedTransform
=======================

.. py:class:: GroupedTransform

A class to describe a GroupedTransformation.

.. rubric:: Attributes:

.. py:attribute:: system

A string - choice of "exp" or "cos" or "chui1" or "chui2" or "chui3" or "chui4" or "mixed".

.. py:attribute:: settings

List of setting objects - uniquely describes the setting such as the bandlimits.

.. py:attribute:: X

Numpy array of dtype float of dimension (M,d) - array of nodes.

.. py:attribute:: transforms

List of DeferredLinearOperator objects - holds the low-dimensional sub transformations.

.. py:attribute:: basis_vect

List of strings - holds for every dimension if a cosinus basis [true] or exponential basis [false] is used.



.. rubric:: Constructor:

.. py:method:: GroupedTransform( system, X, settings = settings, basis_vect = basis_vect)

.. rubric:: Additional Constructor:

.. py:method:: GroupedTransform( system, X, d=d, ds = ds, N =N basis_vect = basis_vect)

.. py:method:: GroupedTransform( system, X, U = U, N = N basis_vect = basis_vect)


.. rubric:: Functions:

.. py:method:: `*`

If `F` is a GroupedTransfom object and `f` is a numpy array,
this overloads the * notation in order to achieve the adjoint transform `f = F*f`.

If `F` is a GroupedTransform object and fhat is a GroupedCoefficient object,
this overloads the * notation in order to achieve `f = F*fhat`.

.. py:method:: adjoint

Overloads the `F'` notation and gives back the same GroupdTransform. GroupedTransform decides by the input if it is the normal trafo or the adjoint so this is only for convinience.

.. py:method:: __getitem__

This function overloads `[]` of GroupedTransform such that you can do `F[(1,3)]` to obtain the transform of the corresponding ANOVA term defined by `u`.
GroupedTransform
================

.. automodule:: pyGroupedTransforms.GroupedTransform
:no-members:

.. autoclass:: pyGroupedTransforms.GroupedTransform.GroupedTransform
:members:
:undoc-members:
:show-inheritance:
:member-order: bysource
:special-members: __mul__, __getitem__

.. autofunction:: pyGroupedTransforms.GroupedTransform.get_superposition_set

.. autofunction:: pyGroupedTransforms.GroupedTransform.get_setting
27 changes: 27 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* Custom overrides to widen the main content area for sphinx_rtd_theme */

/* Increase the maximum content width */
.wy-nav-content,
.rst-content {
max-width: 100vw;
min-height: 100vh;
background-color: redsss;
}

/* Slightly reduce left padding for large screens so content uses more space */
@media (min-width: 1200px) {
.wy-nav-content {
padding-left: 20px;
padding-right: 20px;
}
}

/* Ensure the main document content uses more horizontal space */
.rst-content .section, .document {
margin-left: 0;
margin-right: 0;
}

.rubric {
font-size: 20px;
}
47 changes: 44 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import os
import sys

# -- Path setup --------------------------------------------------------------
# Macht den src-Ordner für Sphinx und autodoc auffindbar
sys.path.insert(0, os.path.abspath("../../src"))

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

Expand All @@ -14,14 +21,48 @@
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ["sphinx.ext.mathjax"]
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon", # Unterstützt Google/NumPy-Style Docstrings
"sphinx.ext.mathjax",
"sphinx.ext.viewcode",
"sphinx.ext.intersphinx",
"myst_parser",
]

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
}

# -- autodoc -----------------------------------------------------------------
autodoc_default_options = {
"members": True,
"undoc-members": True,
"show-inheritance": True,
"member-order": "bysource",
}

# GroupedTransform.py importiert torch und pykeops, die aber nur in den
# Methodenkoerpern benutzt werden. Beide sind sehr gross und werden fuer die
# Docstrings nicht gebraucht, deshalb werden sie hier nur simuliert.
autodoc_mock_imports = ["torch", "pykeops"]

templates_path = ["_templates"]
templates_path = []
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "alabaster"
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_theme_options = {
"collapse_navigation": False,
"sticky_navigation": True,
"navigation_depth": 5,
}
html_css_files = [
"custom.css",
]
Loading