splinebox 0.0.1a0__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.
Files changed (37) hide show
  1. splinebox-0.0.1a0/.github/workflows/test_and_deploy.yml +79 -0
  2. splinebox-0.0.1a0/.gitignore +177 -0
  3. splinebox-0.0.1a0/.pre-commit-config.yaml +20 -0
  4. splinebox-0.0.1a0/.readthedocs.yaml +42 -0
  5. splinebox-0.0.1a0/LICENSE +28 -0
  6. splinebox-0.0.1a0/PKG-INFO +76 -0
  7. splinebox-0.0.1a0/README.md +12 -0
  8. splinebox-0.0.1a0/docs/Makefile +20 -0
  9. splinebox-0.0.1a0/docs/basis_functions.rst +34 -0
  10. splinebox-0.0.1a0/docs/conf.py +63 -0
  11. splinebox-0.0.1a0/docs/index.rst +26 -0
  12. splinebox-0.0.1a0/docs/make.bat +35 -0
  13. splinebox-0.0.1a0/docs/pyplots/plot_b1.py +22 -0
  14. splinebox-0.0.1a0/docs/pyplots/plot_b2.py +26 -0
  15. splinebox-0.0.1a0/docs/pyplots/plot_b3.py +25 -0
  16. splinebox-0.0.1a0/docs/pyplots/plot_catmullrom.py +25 -0
  17. splinebox-0.0.1a0/docs/pyplots/plot_cubichermite.py +27 -0
  18. splinebox-0.0.1a0/docs/pyplots/plot_exponential.py +27 -0
  19. splinebox-0.0.1a0/docs/pyplots/plot_exponentialhermite.py +28 -0
  20. splinebox-0.0.1a0/docs/spline_curves.rst +8 -0
  21. splinebox-0.0.1a0/examples/README.rst +4 -0
  22. splinebox-0.0.1a0/examples/plot_example1.py +44 -0
  23. splinebox-0.0.1a0/pyproject.toml +105 -0
  24. splinebox-0.0.1a0/setup.cfg +4 -0
  25. splinebox-0.0.1a0/src/splinebox/__init__.py +12 -0
  26. splinebox-0.0.1a0/src/splinebox/_version.py +16 -0
  27. splinebox-0.0.1a0/src/splinebox/basis_functions.py +804 -0
  28. splinebox-0.0.1a0/src/splinebox/spline_curves.py +724 -0
  29. splinebox-0.0.1a0/src/splinebox.egg-info/PKG-INFO +76 -0
  30. splinebox-0.0.1a0/src/splinebox.egg-info/SOURCES.txt +35 -0
  31. splinebox-0.0.1a0/src/splinebox.egg-info/dependency_links.txt +1 -0
  32. splinebox-0.0.1a0/src/splinebox.egg-info/requires.txt +12 -0
  33. splinebox-0.0.1a0/src/splinebox.egg-info/top_level.txt +1 -0
  34. splinebox-0.0.1a0/tests/conftest.py +181 -0
  35. splinebox-0.0.1a0/tests/test_basis_functions.py +77 -0
  36. splinebox-0.0.1a0/tests/test_spline_curves.py +89 -0
  37. splinebox-0.0.1a0/tox.ini +29 -0
@@ -0,0 +1,79 @@
1
+ # This workflows will upload a Python Package using Twine when a release is created
2
+ # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3
+
4
+ name: tests
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+ tags:
11
+ - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
12
+ pull_request:
13
+ branches:
14
+ - main
15
+ workflow_dispatch:
16
+
17
+ jobs:
18
+ test:
19
+ name: ${{ matrix.platform }} py${{ matrix.python-version }}
20
+ runs-on: ${{ matrix.platform }}
21
+ strategy:
22
+ matrix:
23
+ platform: [ubuntu-latest, windows-latest, macos-latest]
24
+ python-version: ['3.8', '3.9', '3.10']
25
+
26
+ steps:
27
+ - uses: actions/checkout@v4
28
+
29
+ - name: Set up Python ${{ matrix.python-version }}
30
+ uses: actions/setup-python@v5
31
+ with:
32
+ python-version: ${{ matrix.python-version }}
33
+
34
+ # note: if you need dependencies from conda, considering using
35
+ # setup-miniconda: https://github.com/conda-incubator/setup-miniconda
36
+ # and
37
+ # tox-conda: https://github.com/tox-dev/tox-conda
38
+ - name: Install dependencies
39
+ run: |
40
+ python -m pip install --upgrade pip
41
+ python -m pip install setuptools tox tox-gh-actions
42
+
43
+ # this runs the platform-specific tests declared in tox.ini
44
+ - name: Test with tox
45
+ run: python -m tox
46
+ env:
47
+ PLATFORM: ${{ matrix.platform }}
48
+
49
+ - name: Upload coverage reports to Codecov
50
+ uses: codecov/codecov-action@v4
51
+ env:
52
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
53
+ slug: EPFL-Center-for-Imaging/splinebox
54
+
55
+ deploy:
56
+ # this will run when you have tagged a commit, starting with "v*"
57
+ # and requires that you have put your twine API key in your
58
+ # github secrets (see readme for details)
59
+ needs: [test]
60
+ runs-on: ubuntu-latest
61
+ if: contains(github.ref, 'tags')
62
+ steps:
63
+ - uses: actions/checkout@v3
64
+ - name: Set up Python
65
+ uses: actions/setup-python@v4
66
+ with:
67
+ python-version: "3.x"
68
+ - name: Install dependencies
69
+ run: |
70
+ python -m pip install --upgrade pip
71
+ pip install -U setuptools setuptools_scm wheel twine build
72
+ - name: Build and publish
73
+ env:
74
+ TWINE_USERNAME: __token__
75
+ TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
76
+ run: |
77
+ git tag
78
+ python -m build .
79
+ twine upload dist/*
@@ -0,0 +1,177 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
161
+
162
+
163
+ # OS
164
+ .DS_Store
165
+
166
+ # written by setuptools_scm
167
+ **/_version.py
168
+
169
+ # vim swap files
170
+ **.swp
171
+
172
+ # virtual environment for development
173
+ venv_splinebox
174
+
175
+ # example gallery files
176
+ docs/auto_examples
177
+ docs/sg_execution_times.rst
@@ -0,0 +1,20 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.4.0
4
+ hooks:
5
+ - id: check-docstring-first
6
+ - id: end-of-file-fixer
7
+ - id: trailing-whitespace
8
+ - id: check-yaml # checks for correct yaml syntax for github actions ex.
9
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
10
+ rev: v0.0.290
11
+ hooks:
12
+ - id: ruff
13
+ - repo: https://github.com/psf/black
14
+ rev: 23.9.1
15
+ hooks:
16
+ - id: black
17
+ - repo: https://github.com/pre-commit/mirrors-mypy
18
+ rev: v0.910-1
19
+ hooks:
20
+ - id: mypy
@@ -0,0 +1,42 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ # Set the OS, Python version and other tools you might need
9
+ build:
10
+ os: ubuntu-22.04
11
+ tools:
12
+ python: "3.12"
13
+ # You can also specify other tool versions:
14
+ # nodejs: "19"
15
+ # rust: "1.64"
16
+ # golang: "1.19"
17
+ #
18
+
19
+ # Specify that the extra dependcies for docs listed in the
20
+ # pyproject.toml are installed.
21
+ python:
22
+ install:
23
+ - method: pip
24
+ path: .
25
+ extra_requirements:
26
+ - docs
27
+
28
+ # Build documentation in the "docs/" directory with Sphinx
29
+ sphinx:
30
+ configuration: docs/conf.py
31
+
32
+ # Optionally build your docs in additional formats such as PDF and ePub
33
+ # formats:
34
+ # - pdf
35
+ # - epub
36
+
37
+ # Optional but recommended, declare the Python requirements required
38
+ # to build your documentation
39
+ # See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
40
+ # python:
41
+ # install:
42
+ # - requirements: docs/requirements.txt
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, EPFL Center for Imaging
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,76 @@
1
+ Metadata-Version: 2.1
2
+ Name: splinebox
3
+ Version: 0.0.1a0
4
+ Summary: A python package for fitting splines.
5
+ Author-email: Florian Aymanns <florian.aymanns@epfl.ch>, Virginie Uhlmann <uhlmann@ebi.ac.uk>, Edward Andò <edward.ando@epfl.ch>
6
+ Maintainer-email: Florian Aymanns <flroian.aymanns@epfl.ch>
7
+ License: BSD 3-Clause License
8
+
9
+ Copyright (c) 2024, EPFL Center for Imaging
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are met:
13
+
14
+ 1. Redistributions of source code must retain the above copyright notice, this
15
+ list of conditions and the following disclaimer.
16
+
17
+ 2. Redistributions in binary form must reproduce the above copyright notice,
18
+ this list of conditions and the following disclaimer in the documentation
19
+ and/or other materials provided with the distribution.
20
+
21
+ 3. Neither the name of the copyright holder nor the names of its
22
+ contributors may be used to endorse or promote products derived from
23
+ this software without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
+
36
+ Project-URL: Repository, https://github.com/EPFL-Center-for-Imaging/splinebox
37
+ Keywords: splines
38
+ Classifier: Development Status :: 2 - Pre-Alpha
39
+ Classifier: Intended Audience :: Developers
40
+ Classifier: License :: OSI Approved :: BSD License
41
+ Classifier: Operating System :: OS Independent
42
+ Classifier: Programming Language :: Python
43
+ Classifier: Programming Language :: Python :: 3
44
+ Classifier: Programming Language :: Python :: 3 :: Only
45
+ Classifier: Programming Language :: Python :: 3.8
46
+ Classifier: Programming Language :: Python :: 3.9
47
+ Classifier: Programming Language :: Python :: 3.10
48
+ Classifier: Programming Language :: Python :: 3.11
49
+ Classifier: Programming Language :: Python :: 3.12
50
+ Classifier: Topic :: Scientific/Engineering
51
+ Requires-Python: >=3.8
52
+ Description-Content-Type: text/markdown
53
+ License-File: LICENSE
54
+ Requires-Dist: numpy
55
+ Requires-Dist: scipy
56
+ Requires-Dist: numba
57
+ Provides-Extra: test
58
+ Requires-Dist: tox; extra == "test"
59
+ Requires-Dist: pytest; extra == "test"
60
+ Requires-Dist: pytest-cov; extra == "test"
61
+ Provides-Extra: docs
62
+ Requires-Dist: matplotlib; extra == "docs"
63
+ Requires-Dist: sphinx-gallery; extra == "docs"
64
+
65
+ <img style="float: right;" src="https://imaging.epfl.ch/resources/logo-for-gitlab.svg">
66
+
67
+ # splinebox
68
+ A python package for fitting splines.
69
+ Developed by the [EPFL Center for Imaging](https://imaging.epfl.ch/) as part of a collaboration with the [Uhlmann Group at EMBL-EBI](https://www.ebi.ac.uk/research/uhlmann/) in Feb 2024.
70
+
71
+ [![Documentation Status](https://readthedocs.org/projects/splinebox/badge/?version=latest)](https://splinebox.readthedocs.io/en/latest/?badge=latest)
72
+ [![License BSD-3](https://img.shields.io/pypi/l/splinebox.svg?color=green)](https://github.com/EPFL-Center-for-Imaging/splinebox/raw/main/LICENSE)
73
+ [![PyPI](https://img.shields.io/pypi/v/splinebox.svg?color=green)](https://pypi.org/project/splinebox)
74
+ [![Python Version](https://img.shields.io/pypi/pyversions/splinebox.svg?color=green)](https://python.org)
75
+ [![tests](https://github.com/EPFL-Center-for-Imaging/splinebox/workflows/tests/badge.svg)](https://github.com/EPFL-Center-for-Imaging/splinebox/actions)
76
+ [![codecov](https://codecov.io/gh/EPFL-Center-for-Imaging/splinebox/branch/main/graph/badge.svg)](https://codecov.io/gh/EPFL-Center-for-Imaging/splinebox)
@@ -0,0 +1,12 @@
1
+ <img style="float: right;" src="https://imaging.epfl.ch/resources/logo-for-gitlab.svg">
2
+
3
+ # splinebox
4
+ A python package for fitting splines.
5
+ Developed by the [EPFL Center for Imaging](https://imaging.epfl.ch/) as part of a collaboration with the [Uhlmann Group at EMBL-EBI](https://www.ebi.ac.uk/research/uhlmann/) in Feb 2024.
6
+
7
+ [![Documentation Status](https://readthedocs.org/projects/splinebox/badge/?version=latest)](https://splinebox.readthedocs.io/en/latest/?badge=latest)
8
+ [![License BSD-3](https://img.shields.io/pypi/l/splinebox.svg?color=green)](https://github.com/EPFL-Center-for-Imaging/splinebox/raw/main/LICENSE)
9
+ [![PyPI](https://img.shields.io/pypi/v/splinebox.svg?color=green)](https://pypi.org/project/splinebox)
10
+ [![Python Version](https://img.shields.io/pypi/pyversions/splinebox.svg?color=green)](https://python.org)
11
+ [![tests](https://github.com/EPFL-Center-for-Imaging/splinebox/workflows/tests/badge.svg)](https://github.com/EPFL-Center-for-Imaging/splinebox/actions)
12
+ [![codecov](https://codecov.io/gh/EPFL-Center-for-Imaging/splinebox/branch/main/graph/badge.svg)](https://codecov.io/gh/EPFL-Center-for-Imaging/splinebox)
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = .
9
+ BUILDDIR = _build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,34 @@
1
+ Basis functions
2
+ ===============
3
+
4
+ .. autoclass:: splinebox.basis_functions.BasisFunction
5
+ :members:
6
+ :undoc-members:
7
+
8
+ .. autoclass:: splinebox.basis_functions.B1
9
+
10
+ .. plot:: pyplots/plot_b1.py
11
+
12
+ .. autoclass:: splinebox.basis_functions.B2
13
+
14
+ .. plot:: pyplots/plot_b2.py
15
+
16
+ .. autoclass:: splinebox.basis_functions.B3
17
+
18
+ .. plot:: pyplots/plot_b3.py
19
+
20
+ .. autoclass:: splinebox.basis_functions.Exponential
21
+
22
+ .. plot:: pyplots/plot_exponential.py
23
+
24
+ .. autoclass:: splinebox.basis_functions.CatmullRom
25
+
26
+ .. plot:: pyplots/plot_catmullrom.py
27
+
28
+ .. autoclass:: splinebox.basis_functions.CubicHermite
29
+
30
+ .. plot:: pyplots/plot_cubichermite.py
31
+
32
+ .. autoclass:: splinebox.basis_functions.ExponentialHermite
33
+
34
+ .. plot:: pyplots/plot_exponentialhermite.py
@@ -0,0 +1,63 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+ #
3
+ # This file only contains a selection of the most common options. For a full
4
+ # list see the documentation:
5
+ # https://www.sphinx-doc.org/en/master/usage/configuration.html
6
+
7
+ # -- Path setup --------------------------------------------------------------
8
+
9
+ # If extensions (or modules to document with autodoc) are in another directory,
10
+ # add these directories to sys.path here. If the directory is relative to the
11
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
12
+ #
13
+ # import os
14
+ # import sys
15
+ # sys.path.insert(0, os.path.abspath('.'))
16
+
17
+
18
+ # -- Project information -----------------------------------------------------
19
+
20
+
21
+ project = "splinebox"
22
+ copyright = "2024, Florian Aymanns, Virginie Uhlmann, Edward Ando" # noqa: A001
23
+ author = "Florian Aymanns, Virginie Uhlmann, Edward Ando"
24
+
25
+
26
+ # -- General configuration ---------------------------------------------------
27
+
28
+ # Add any Sphinx extension module names here, as strings. They can be
29
+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
30
+ # ones.
31
+ extensions = [
32
+ "sphinx.ext.mathjax",
33
+ "sphinx.ext.autodoc",
34
+ "matplotlib.sphinxext.plot_directive",
35
+ "sphinx_gallery.gen_gallery",
36
+ ]
37
+
38
+ # Add any paths that contain templates here, relative to this directory.
39
+ templates_path = ["_templates"]
40
+
41
+ # List of patterns, relative to source directory, that match files and
42
+ # directories to ignore when looking for source files.
43
+ # This pattern also affects html_static_path and html_extra_path.
44
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
45
+
46
+
47
+ # -- Options for HTML output -------------------------------------------------
48
+
49
+ # The theme to use for HTML and HTML Help pages. See the documentation for
50
+ # a list of builtin themes.
51
+ #
52
+ html_theme = "alabaster"
53
+
54
+ # Add any paths that contain custom static files (such as style sheets) here,
55
+ # relative to this directory. They are copied after the builtin static files,
56
+ # so a file named "default.css" will overwrite the builtin "default.css".
57
+ html_static_path = ["_static"]
58
+
59
+ # Example gallery configuration
60
+ sphinx_gallery_conf = {
61
+ "examples_dirs": "../examples", # path to your example scripts
62
+ "gallery_dirs": "auto_examples", # path to where to save gallery generated output
63
+ }
@@ -0,0 +1,26 @@
1
+ .. splinebox documentation master file, created by
2
+ sphinx-quickstart on Tue Feb 20 16:01:44 2024.
3
+ You can adapt this file completely to your liking, but it should at least
4
+ contain the root `toctree` directive.
5
+
6
+ Welcome to splinebox's documentation!
7
+ =====================================
8
+
9
+ .. toctree::
10
+ :maxdepth: 2
11
+ :caption: Contents:
12
+
13
+ basis_functions
14
+ spline_curves
15
+ auto_examples/index.rst
16
+
17
+ .. math::
18
+ f(x) = \sum_{k=0}^{M-1} c[k]\phi(x-k)
19
+
20
+
21
+ Indices and tables
22
+ ==================
23
+
24
+ * :ref:`genindex`
25
+ * :ref:`modindex`
26
+ * :ref:`search`
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=.
11
+ set BUILDDIR=_build
12
+
13
+ %SPHINXBUILD% >NUL 2>NUL
14
+ if errorlevel 9009 (
15
+ echo.
16
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17
+ echo.installed, then set the SPHINXBUILD environment variable to point
18
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
19
+ echo.may add the Sphinx directory to PATH.
20
+ echo.
21
+ echo.If you don't have Sphinx installed, grab it from
22
+ echo.https://www.sphinx-doc.org/
23
+ exit /b 1
24
+ )
25
+
26
+ if "%1" == "" goto help
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,22 @@
1
+ import matplotlib.pyplot as plt
2
+ import numpy as np
3
+ import splinebox.basis_functions
4
+
5
+ fig, axes = plt.subplots(2, 1, sharex=True)
6
+
7
+ b1 = splinebox.basis_functions.B1()
8
+
9
+ x = np.linspace(-2, 2, 100)
10
+
11
+ b1_0th = b1.eval(x)
12
+ b1_1st = b1.eval(x, derivative=1)
13
+
14
+ fig.suptitle("B1 basis function and its derivatives")
15
+ axes[0].plot(x, b1_0th, label=r"$f(x)$")
16
+ axes[0].legend()
17
+ axes[1].plot(x, b1_1st, label=r"$\frac{df}{dx}(x)$")
18
+ axes[1].legend()
19
+ axes[1].set_xlabel(r"$x$")
20
+ plt.tight_layout()
21
+
22
+ plt.show()
@@ -0,0 +1,26 @@
1
+ import matplotlib.pyplot as plt
2
+ import numpy as np
3
+ import splinebox.basis_functions
4
+
5
+ fig, axes = plt.subplots(3, 1, sharex=True)
6
+
7
+ b2 = splinebox.basis_functions.B2()
8
+
9
+ x = np.linspace(-2, 2, 100)
10
+
11
+ b2_0th = b2.eval(x)
12
+ b2_1st = b2.eval(x, derivative=1)
13
+ b2_2nd = b2.eval(x, derivative=2)
14
+
15
+
16
+ fig.suptitle("B2 basis function and its derivatives")
17
+ axes[0].plot(x, b2_0th, label=r"$f(x)$")
18
+ axes[0].legend()
19
+ axes[1].plot(x, b2_1st, label=r"$\frac{df}{dx}(x)$")
20
+ axes[1].legend()
21
+ axes[2].plot(x, b2_2nd, label=r"$\frac{d^2f}{dx^2}(x)$")
22
+ axes[2].legend()
23
+ axes[2].set_xlabel(r"$x$")
24
+ plt.tight_layout()
25
+
26
+ plt.show()