Skip to main content

A Python package for state estimation using Kalman and Particle Filters

Project description

tfilterspy logo

TFiltersPy 🌀

PyPI Version Tests Build License

TFiltersPy is your new favorite Python library for implementing state-of-the-art Bayesian filtering techniques like Kalman Filters and Particle Filters. Whether you're working on noisy linear systems, nonlinear dynamics, or want to sound cool at a party when you say "I coded my own Kalman Filter," this is the library for you!


What’s Inside? 📦

🎉 TFiltersPy offers:

  • Kalman Filters 🧮 – A classic but still iconic tool for linear filtering and smoothing.
  • Particle Filters 🎲 – Sampling-based estimators for nonlinear systems.
  • Nonlinear Filters 🔀 – For when your system decides to be complicated.
  • Extensible design for implementing more advanced filtering algorithms like Unscented Kalman Filters (UKF) and beyond.

Installation 🚀

Getting started is as easy as pie (or Pi)! 🍰

pip install tfilterpy

Want to contribute or tinker with the code? Clone the repo and install the development dependencies:

git clone https://github.com/LeparaLaMapara/tfilterpy.git
cd tfilterpy
pip install .[dev]

Usage 🛠️

Example 1: Using a Kalman Filter to tame noisy data 🤖

import numpy as np
from TFilterPy.state_estimation.linear_filters import DaskKalmanFilter

# Define your system
F = np.eye(2)
H = np.eye(2)
Q = np.eye(2) * 0.01
R = np.eye(2) * 0.1
x0 = np.zeros(2)
P0 = np.eye(2)

# Create a Kalman Filter
kf = DaskKalmanFilter(F, H, Q, R, x0, P0)

# Simulate some noisy measurements
measurements = np.random.randn(100, 2)

# Run the filter
filtered_states = kf.run_filter(measurements)
print(filtered_states.compute())

Features 🌟

  • Dask Support for large-scale filtering with parallelism 🏎️
  • Modular structure for extensibility 🛠️
  • Lightweight and easy to use 👌
  • Designed for both linear and nonlinear systems 🔄

Why TFilterPy? 💡

Because Kalman deserves better branding! Instead of grappling with matrices and equations from scratch, use TFilterPy and focus on the fun part: tweaking models until they (hopefully) work. 🎉


Contributing 🤝

We welcome contributions of all types:

  • 🐛 Found a bug? Let us know in the Issues.
  • 🌟 Want to add a feature? Fork the repo, make your changes, and create a pull request.
  • 🧪 Testers needed! Write more test cases for improved coverage.

Development Setup

  1. Clone the repo:
  git clone https://github.com/LeparaLaMapara/tfilterpy.git
  1. Install dependencies:
  pip install .[dev]
  1. Run tests:
  pytest tests/

Future Plans 🔮

  • Adding Unscented Kalman Filters (UKF) 🦄
  • Implementing Gaussian Process Filters 📈
  • Enhancing scalability with advanced parallelism ⚡

Documentation 📚

Detailed documentation is available at: https://leparalamapara.github.io/tfilterpy (Yes, we made it look fancy. You're welcome. ✨)


Support ❤️

If this library made your life easier, consider:

Giving it a ⭐ on GitHub.
Telling your friends, colleagues, and cats about TFilterPy.

License 📜

This project is licensed under the MIT License. Feel free to use it, modify it, or use it as a coaster.

Enjoy your filtering adventures with TFilterPy! 🎉🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tfilterspy-1.0.3.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tfilterspy-1.0.3-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file tfilterspy-1.0.3.tar.gz.

File metadata

  • Download URL: tfilterspy-1.0.3.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for tfilterspy-1.0.3.tar.gz
Algorithm Hash digest
SHA256 cd139ee955c97b309a5614ef0284f8b4167e8aa9f24110a8e6e24cd55f555da8
MD5 54e34f9531ef37316bc80aec18689b7b
BLAKE2b-256 444f70fcea390523c754f0f356a7c8a85f131b98f84e7d3f20d53e1aa55d11a2

See more details on using hashes here.

File details

Details for the file tfilterspy-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: tfilterspy-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for tfilterspy-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7951f6458fd42456b1fc31b23dcef831ec0d84696320b8a7b5822bcf446d8289
MD5 03f4583ccca995a6e4aa3c5254fa30b3
BLAKE2b-256 30c311d794de38ba51a4bf2ca58494b317b9a2bbf48272c394be58a0e4c54722

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page