Metadata-Version: 2.4
Name: sensorfusion-tools
Version: 2026.0.0
Summary: Python helper library for the TSRT14 Sensor Fusion Course at LiU
Author: Gustaf Hendeby
Author-email: Gustaf Hendeby <hendeby@gmail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering
Requires-Dist: matplotlib>=3.10.8
Requires-Dist: numpy>=2.4.4
Requires-Dist: scipy>=1.17.1
Requires-Dist: tqdm>=4.67.3
Requires-Python: >=3.14
Description-Content-Type: text/markdown

# sensorfusion-tools

Signal-systems utilities for estimation, modeling, and plotting.

## Versioning

This library uses calendar-style semantic versions: `YYYY.FEATURE.BUGFIX`.

- `YYYY`: release year (for long-term timeline tracking)
- `FEATURE`: increments for new functionality
- `BUGFIX`: increments for patches and fixes

## Framework And Tooling

- Language: Python 3.14+
- Build backend: `uv_build`
- Package/dependency workflow: `uv`
- Numerical stack: `numpy`, `scipy`
- Plotting: `matplotlib`

## Testing Framework

- Test runner: `pytest`
- Property-based testing: `hypothesis`
- Coverage: `pytest-cov` (configured for `src/sftools`)

Run tests:

```bash
uv run pytest
```

Run only sftools tests:

```bash
uv run pytest tests/sftools
```

## Code Quality

- Linting: `ruff`

Run lint:

```bash
uv run ruff check .
```

## CI (GitLab)

The pipeline is defined in [.gitlab-ci.yml](.gitlab-ci.yml) and includes:

- `quality` stage: `ruff` lint checks
- `test` stage: `pytest` with JUnit artifact output

CI uses `python:3.14-slim` and installs dependencies with:

```bash
uv sync --group dev
```

## License

Distributed under the MIT License. See [LICENSE](LICENSE) for details.

## Project Structure

```text
src/
	sftools/        # Main signal-system models, estimators, helpers, plotting, shared types

tests/
	sftools/          # Pytest suite for src/sftools (one test file per source file)
	fixtures/         # Regression test input/output fixtures
```

For sftools, tests mirror the source layout:

- `src/sftools/model_obs.py` -> `tests/sftools/test_model.py`
- `src/sftools/estimator.py` -> `tests/sftools/test_estimator.py`
- `src/sftools/helper.py` -> `tests/sftools/test_helper.py`
- `src/sftools/plot.py` -> `tests/sftools/test_plot.py`

Shared state/trajectory datatypes are defined in `src/sftools/types.py`:

- `GaussianState`
- `ParticleState`
- `StateTrajectory` (supports probabilistic trajectories via `write_state` and deterministic trajectories via `write_mean`)

Useful `StateTrajectory` iteration helpers:

- `for y in traj` yields state columns with shape `(n, 1)`
- `traj.iter_samples(include_cov=True, include_time=True)` yields `(y, cov, t)` tuples when available

Plotting helpers in `src/sftools/plot.py` use `StateTrajectory` inputs.

Particle filter helper:

- `ParticleFilter.init_state_gaussian(mean, cov, n_particles)` initializes a `ParticleState` from a Gaussian prior using the filter RNG.
