pyANOVAapprox 2.0.3__tar.gz → 2.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/.github/workflows/documentation.yml +12 -4
- pyanovaapprox-2.0.5/.github/workflows/format.yml +42 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/.gitignore +4 -1
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/PKG-INFO +1 -1
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/docs/source/conf.py +16 -2
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/docs/source/index.rst +2 -3
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/pyproject.toml +1 -1
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/simpleTest/exampleWavelet.py +12 -6
- pyanovaapprox-2.0.5/simpleTest/friedman.ipynb +1515 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/src/pyANOVAapprox/analysis.py +16 -29
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/src/pyANOVAapprox/approx.py +2 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/src/pyANOVAapprox/bandwidth.py +19 -14
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/src/pyANOVAapprox/errors.py +11 -23
- pyanovaapprox-2.0.3/.github/workflows/format.yml +0 -27
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/.github/workflows/ci.yml +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/.github/workflows/release.yml +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/LICENSE +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/README.md +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/docs/Makefile +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/docs/source/Analysis.rst +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/docs/source/Approximation.rst +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/docs/source/Errors.rst +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/simpleTest/TestFunctionPeriodic.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/simpleTest/exampleAutoapproximate.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/simpleTest/exampleCheb.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/simpleTest/exampleClassification.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/simpleTest/exampleNonPeriodic.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/simpleTest/examplePeriodic.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/src/pyANOVAapprox/__init__.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/src/pyANOVAapprox/fista.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/src/pyANOVAapprox/trafos.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/tests/TestFunctionCheb.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/tests/TestFunctionPeriodic.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/tests/cheb_fista.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/tests/cheb_lsqr.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/tests/per_fista.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/tests/per_lsqr.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/tests/run_tests.py +0 -0
- {pyanovaapprox-2.0.3 → pyanovaapprox-2.0.5}/tests/wav_lsqr.py +0 -0
|
@@ -10,20 +10,28 @@ jobs:
|
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
12
|
- uses: actions/checkout@v4
|
|
13
|
+
|
|
13
14
|
- uses: actions/setup-python@v5
|
|
15
|
+
with:
|
|
16
|
+
python-version: "3.12"
|
|
17
|
+
|
|
14
18
|
- name: Install dependencies
|
|
15
19
|
run: |
|
|
16
20
|
pip install sphinx sphinx_rtd_theme myst_parser
|
|
21
|
+
# WICHTIG: Wenn dein Code Abhängigkeiten hat (z.B. numpy, scipy),
|
|
22
|
+
# installiere sie hier, sonst kann 'autodoc' den Code nicht importieren!
|
|
23
|
+
# pip install -e .
|
|
24
|
+
|
|
17
25
|
- name: Sphinx build
|
|
18
26
|
run: |
|
|
19
27
|
cd docs
|
|
20
28
|
sphinx-apidoc -o ./source ../src -f
|
|
21
29
|
make html
|
|
30
|
+
|
|
22
31
|
- name: Deploy to GitHub Pages
|
|
23
|
-
uses: peaceiris/actions-gh-pages@
|
|
32
|
+
uses: peaceiris/actions-gh-pages@v4
|
|
24
33
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
25
34
|
with:
|
|
26
|
-
publish_branch: gh-pages
|
|
27
35
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
28
|
-
publish_dir: docs/build/html
|
|
29
|
-
force_orphan: true
|
|
36
|
+
publish_dir: docs/build/html
|
|
37
|
+
force_orphan: true
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Format Python Code
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- '**' # Läuft bei jedem Push auf absolut jeden Branch...
|
|
7
|
+
tags-ignore:
|
|
8
|
+
- '**' # ...ABER ignoriert jeden Push, der ein Tag (Release) ist.
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
python-code-format:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
pull-requests: write
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
architecture: "x64"
|
|
23
|
+
|
|
24
|
+
- name: Display Python version
|
|
25
|
+
run: python --version
|
|
26
|
+
|
|
27
|
+
- name: Install packages
|
|
28
|
+
run: pip install black isort
|
|
29
|
+
|
|
30
|
+
- name: Formatter
|
|
31
|
+
run: |
|
|
32
|
+
black .
|
|
33
|
+
isort .
|
|
34
|
+
- name: Create Pull Request
|
|
35
|
+
uses: peter-evans/create-pull-request@v6
|
|
36
|
+
with:
|
|
37
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
38
|
+
commit-message: "style: auto code format"
|
|
39
|
+
title: "Fixes by format action"
|
|
40
|
+
body: "This is an auto-generated PR with code formatting fixes."
|
|
41
|
+
labels: automated pr
|
|
42
|
+
branch: python-code-format-patches
|
|
@@ -7,6 +7,7 @@ dist/
|
|
|
7
7
|
__pycache__/
|
|
8
8
|
venv/
|
|
9
9
|
venv2/
|
|
10
|
+
.venv/
|
|
10
11
|
|
|
11
12
|
bin/
|
|
12
13
|
/lib64/
|
|
@@ -17,4 +18,6 @@ src/pyNFFT3/lib/AVX2/libgomp-1.dll
|
|
|
17
18
|
src/pyNFFT3/lib/AVX2/libgcc_s_seh-1.dll
|
|
18
19
|
src/pyNFFT3/lib/AVX2/libwinpthread-1.dll
|
|
19
20
|
simpleTest/venv/
|
|
20
|
-
bandwidth_detection
|
|
21
|
+
bandwidth_detection*
|
|
22
|
+
cross_validation*
|
|
23
|
+
/src/pyANOVAapprox/.ipynb_checkpoints/
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
# For the full list of built-in configuration values, see the documentation:
|
|
4
4
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
5
|
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
# -- Path setup --------------------------------------------------------------
|
|
10
|
+
# Macht den src-Ordner für Sphinx und autodoc auffindbar
|
|
11
|
+
sys.path.insert(0, os.path.abspath("../../src"))
|
|
12
|
+
|
|
6
13
|
# -- Project information -----------------------------------------------------
|
|
7
14
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
8
15
|
|
|
@@ -14,7 +21,13 @@ release = "29.07.2025"
|
|
|
14
21
|
# -- General configuration ---------------------------------------------------
|
|
15
22
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
16
23
|
|
|
17
|
-
|
|
24
|
+
# Erweiterungen hinzugefügt, damit automodule, Mathe und Markdown funktionieren
|
|
25
|
+
extensions = [
|
|
26
|
+
"sphinx.ext.autodoc",
|
|
27
|
+
"sphinx.ext.napoleon", # Unterstützt Google/NumPy-Style Docstrings
|
|
28
|
+
"sphinx.ext.mathjax",
|
|
29
|
+
"myst_parser",
|
|
30
|
+
]
|
|
18
31
|
|
|
19
32
|
templates_path = ["_templates"]
|
|
20
33
|
exclude_patterns = []
|
|
@@ -23,5 +36,6 @@ exclude_patterns = []
|
|
|
23
36
|
# -- Options for HTML output -------------------------------------------------
|
|
24
37
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
25
38
|
|
|
26
|
-
|
|
39
|
+
# Auf das im Workflow genutzte Theme umgestellt
|
|
40
|
+
html_theme = "sphinx_rtd_theme"
|
|
27
41
|
html_static_path = ["_static"]
|
|
@@ -74,20 +74,23 @@ anova_model = ANOVAapprox.approx(X, y, ds=q, basis=basis, N=N)
|
|
|
74
74
|
|
|
75
75
|
#### Do approximation by least-squares ###
|
|
76
76
|
anova_model.approximate(lam=lambdas, solver="lsqr")
|
|
77
|
-
print(
|
|
77
|
+
print(
|
|
78
|
+
"Total number of used parameters = "
|
|
79
|
+
+ str(len(anova_model.getFc()[lambdas[0]].vec()))
|
|
80
|
+
)
|
|
78
81
|
|
|
79
82
|
#######################
|
|
80
83
|
## Analyze the model ##
|
|
81
84
|
#######################
|
|
82
85
|
|
|
83
86
|
### Do sensitivity analysis ####
|
|
84
|
-
anova_model.get_GSI(
|
|
87
|
+
gsis = anova_model.get_GSI(
|
|
85
88
|
lam=0.0
|
|
86
|
-
) # calculates indices for importance of terms (gsis is vector, with indices belonging to terms in anova_model.U)
|
|
87
|
-
anova_model.get_GSI(lam=0.0, Dict=
|
|
89
|
+
) # calculates indices for importance of terms (gsis is vector, with indices belonging to terms in anova_model.getSetting().U)
|
|
90
|
+
anova_model.get_GSI(lam=0.0, Dict=True)
|
|
88
91
|
|
|
89
92
|
y_min_calc = 10 ** (np.min(np.log10(gsis)) - 0.5)
|
|
90
|
-
label = list(anova_model.U[1:])
|
|
93
|
+
label = list(anova_model.getSetting().U[1:])
|
|
91
94
|
l = len(label)
|
|
92
95
|
plt.figure()
|
|
93
96
|
x_values = np.arange(1, l + 1)
|
|
@@ -128,7 +131,10 @@ anova_model = anova_model.approx(
|
|
|
128
131
|
X=X, y=y, U=U, N=[i + 2 for i in N], basis=basis
|
|
129
132
|
) # increase number of paramers in N for the important terms
|
|
130
133
|
anova_model.approximate(lam=lambdas)
|
|
131
|
-
print(
|
|
134
|
+
print(
|
|
135
|
+
"Total number of used parameters = "
|
|
136
|
+
+ str(len(anova_model.getFc()[lambdas[0]].vec()))
|
|
137
|
+
)
|
|
132
138
|
mse_train = anova_model.get_mse(lam=0.0)
|
|
133
139
|
mse_test = anova_model.get_mse(X=X_test, y=y_test, lam=0.0)
|
|
134
140
|
print("MSE on test points after ANOVA truncation: " + str(mse_test))
|