Committing some initial scaffolding
This commit is contained in:
commit
f99280d1f9
5 files changed
+112
No files matched your search
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/bin/sh
|
||||
# Fast checks only. Measured on a warm tree: fmt 0.06s, clippy 0.07s,
|
||||
# `cargo test --lib` 0.44s, so this hook is about six tenths of a second.
|
||||
#
|
||||
# The full `cargo test` is 4.0s — the integration tests run Monte Carlo ensembles
|
||||
# in a debug build — and `cargo doc` wants the whole dependency graph, so both are
|
||||
# in pre-push instead.
|
||||
#
|
||||
# Install: git config core.hooksPath .githooks
|
||||
set -e
|
||||
|
||||
echo "pre-commit: cargo fmt --check"
|
||||
cargo fmt --check
|
||||
|
||||
echo "pre-commit: cargo clippy"
|
||||
cargo clippy --all-targets -- -D warnings
|
||||
|
||||
echo "pre-commit: cargo test --lib"
|
||||
cargo test --quiet --lib
|
||||
|
||||
echo "pre-commit: US spelling"
|
||||
staged=$(git diff --cached --name-only --diff-filter=ACM -- '*.rs' '*.md' '*.toml')
|
||||
if [ -n "$staged" ]; then
|
||||
# shellcheck disable=SC2086
|
||||
hits=$(git grep -wniE -e 'metre|metres|kilometre|kilometres' \
|
||||
-e 'licence|defence|programme|catalogue|grey' \
|
||||
-e 'manoeuvre|manoeuvres|manoeuvred|manoeuvring' \
|
||||
-e 'normalise|normalised|normalises|normalising|normalisation' \
|
||||
-e 'stabilise|stabilised|stabilises|stabilising|stabilisation' \
|
||||
-e 'recognise|recognised|recognises|recognising' \
|
||||
-e 'monomorphise|monomorphised|monomorphises|monomorphising' \
|
||||
-e 'serialise|serialised|serialises|serialising|serialisation' \
|
||||
-e 'behaviour|behaviours|colour|colours|centre|centres' \
|
||||
-e 'analyse|analysed|analyses|analysing' \
|
||||
-e 'organise|organised|organisation|optimise|optimised|optimisation' \
|
||||
-e 'initialise|initialised|initialisation|utilise|utilised' \
|
||||
-e 'modelling|modelled|unmodelled|mismodelling|labelled|cancelled|travelled' \
|
||||
-e 'favour|favours|honour|honours|neighbour|neighbours' \
|
||||
--cached -- $staged || true)
|
||||
if [ -n "$hits" ]; then
|
||||
echo "$hits"
|
||||
echo
|
||||
echo "pre-commit: British spellings found above. This project uses US English."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "pre-commit: ok"
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# Everything pre-commit is too slow to run: 4.0s for the full test suite on a warm
|
||||
# tree, against 0.6s for the hook that runs on every commit. The doctests matter
|
||||
# here because the readme is the crate's front page, so its examples are compiled
|
||||
# and cannot drift from the API.
|
||||
#
|
||||
# Install: git config core.hooksPath .githooks
|
||||
set -e
|
||||
|
||||
echo "pre-push: cargo test"
|
||||
cargo test --quiet
|
||||
|
||||
echo "pre-push: cargo doc"
|
||||
RUSTDOCFLAGS="-D warnings" cargo doc --quiet --no-deps
|
||||
|
||||
echo "pre-push: ok"
|
||||
@@ -0,0 +1,2 @@
|
||||
/target
|
||||
/Cargo.lock
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
[package]
|
||||
name = "nonlinear-filters"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
authors = ["Connor Johnstone"]
|
||||
description = "Sigma-point nonlinear filters with adaptive, gating, consider-covariance and multiple-model variants, plus consistency diagnostics."
|
||||
readme = "readme.md"
|
||||
repository = "https://git.rcjohnstone.com/connor/nonlinear-filters"
|
||||
license = "MIT"
|
||||
exclude = [".githooks/"]
|
||||
keywords = ["kalman", "ukf", "filtering", "estimation", "sigma-point"]
|
||||
categories = ["science", "mathematics", "algorithms"]
|
||||
|
||||
[dependencies]
|
||||
nalgebra = { version = "0.35", features = ["serde-serialize"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
thiserror = "2.0"
|
||||
|
||||
[dev-dependencies]
|
||||
approx = "0.5"
|
||||
criterion = "0.7"
|
||||
|
||||
[[bench]]
|
||||
name = "ukf"
|
||||
harness = false
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Connor Johnstone
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Reference in new issue
Block a user