Skip to main content

splinebox

A Python package for fitting splines. Developed by the EPFL Center for Imaging as part of a collaboration with the Uhlmann Group at EMBL-EBI in Feb 2024.

Documentation Status License BSD-3 PyPI Python Version tests codecov DOI

Features

  • Flexible spline fitting for various applications.
  • Support for many spline types in any dimensionality.
  • High-performance implementation in Python.
  • Extensive documentation with examples

Installation

You can install splinebox via pip:

pip install splinebox

Usage

Here is a minimal example of a cubic B-spline in 2D with 3 knots.

import splinebox
import numpy as np
import matplotlib.pyplot as plt

n_knots = 4
spline = splinebox.spline_curves.Spline(M=n_knots, basis_function=splinebox.basis_functions.B3(), closed=True)
spline.knots = np.array([[1, 2], [3, 2], [4, 3], [1, 1]])

t = np.linspace(0, n_knots, 100)
vals = spline(t, derivative=0)

plt.scatter(spline.knots[:, 0], spline.knots[:, 1])
plt.plot(vals[:, 0], vals[:, 1])
plt.show()

Support

If you encounter any problems, please file an issue describing the issue and include a minimal example to reproduce the issue.

Contributing

We welcome contributions! Before you submit a pull request, please ensure that the tests are passing. You can run the tests with pytest. If you are unsure how to implement something, feel free to open an issue to discuss.

Citing splinebox

If you use splinebox in the context of scientific publication, please cite it as follows. Note that you will have to fill in the version yourself. If you are unsure what version you are running, you can find out by running

import splinebox
print(splinebox.__version__)

BibTeX:

@misc{splinebox,
  author = {Aymanns, Florian and Andò, Edward and Uhlmann, Virginie},
  title = {{S}pline{B}ox},
  url = {https://pypi.org/project/splinebox/},
  doi = {10.5281/zenodo.13358354},
  note = {{V}ersion V.V.Vb1},
  year = 2024,
}

License

This is an open source project licensed under the BSD-3-Clause License.

Metadata

Release files for splinebox 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for splinebox 1.1.1
File Size Uploaded Provenance Actions
splinebox-1.1.1.tar.gz 1.6 MB Without provenance Details for splinebox-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for splinebox 1.1.1
File Interpreter ABI Platform Actions
splinebox-1.1.1-py3-none-any.whl Python 3 none any Details for splinebox-1.1.1-py3-none-any.whl

Total release size: 1.7 MB

Release files / splinebox-1.1.1.tar.gz

Download URL splinebox-1.1.1.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
8d73a26006c417a0d28ac0ec16ca52f5b0b1adcbdef53cc2a02c3c872ff891fc
BLAKE2b-256 checksum
How to use checksums
b20516f8176df190307b24c3a18e9d63e9a8284320d79cb24ee6f68f49457639
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / splinebox-1.1.1-py3-none-any.whl

Download URL splinebox-1.1.1-py3-none-any.whl
Size 44.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
159077c0ce7ccafc9e3e71f9985b66c9ea37918a155f58aad6fc2e33da189d98
BLAKE2b-256 checksum
How to use checksums
3cd576d5ed0988d58bab696dc5bd981eb0b4e1f23bee69d3c895dd21e8def002
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for splinebox 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page