mirror of
https://github.com/metabarcoding/obitools4.git
synced 2026-04-30 03:50:39 +00:00
⬆️ version bump to v4.5
- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5" - Update version.txt from 4.29 → .30 (automated by Makefile)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# `obistats` Package — Semantic Overview
|
||||
|
||||
The `*obistats*` Go package provides lightweight, type-generic statistical utilities for numerical data.
|
||||
|
||||
## Core Functions
|
||||
|
||||
- **`Median[T Number](data []T) float64`**
|
||||
Computes the median of a slice. Internally copies and sorts input data to avoid mutation, handling both even- and odd-length slices correctly. Returns `0` for empty input.
|
||||
|
||||
- **`Mean[T Number](data []T) float64`**
|
||||
Calculates the arithmetic mean by summing all elements (converted to `float64`) and dividing by count.
|
||||
|
||||
## Type Constraints
|
||||
|
||||
- Uses Go generics (`constraints.Float | constraints.Integer`), enabling use with `int`, `float32`, `float64`, etc.
|
||||
|
||||
## Design Notes
|
||||
|
||||
- Non-mutating (`Median` works on a copy).
|
||||
- Simple, efficient implementations—no external dependencies beyond `golang.org/x/exp/constraints` and `slices`.
|
||||
- Focused on central tendency measures only—no variance, std dev, or distribution stats.
|
||||
|
||||
## Use Case
|
||||
|
||||
Ideal for small-to-medium numerical datasets where minimal dependencies and clarity are prioritized over advanced statistics.
|
||||
Reference in New Issue
Block a user