# Changelog
All notable changes to this project will be documented in this file.

The format loosely follows Keep a Changelog and Semantic Versioning (SemVer).
Categories: Added | Changed | Fixed | Removed | Performance | Docs | Internal.

## [0.7.0] - 2025-11-15
Minor release (new non-breaking features).

### Added
- New Rust modules & functions:
  - `processes.rs`: `moving_average_temporal`, `moving_average_temporal_stride`, `pixelwise_transform`, `temporal_composite` (weighted 4D temporal compositing).
  - `trends.rs`: `TrendSegment` class, `trend_analysis`, `linear_regression`.
  - `temporal_sum` added to `temporal.rs` and exported (time-axis summation with NaN skip/propagate semantics).
- Benchmark & distribution artifacts: `benchmark-*.json` (per Python version), `benchmark-test.json`, `dist_bench.json`, `dist_bench.md`.
- Trend analysis benchmark script: `scripts/benchmark_trends.py`.
- Sphinx documentation expansion:
  - Per-function API pages under `docs/source/api/functions/*.rst`.
  - Benchmark and distribution pages (`benchmarks.rst`, individual benchmark rst files, `dist_bench.rst`).
  - Custom CSS `_static/custom.css`.
- GitHub Pages deployment workflow (`.github/workflows/static.yml`) for published documentation site.
- `.readthedocs.yaml` configuration (enables RTD builds).
- Advanced temporal processing & trend analysis sections in README (moving average, stride variant, pixelwise transform, trend analysis example).
- New examples: `examples/processes_examples.py`, `examples/temporal_sum_composite_example.py`.

### Changed
- Version bumped to `0.7.0` in `pyproject.toml` and `Cargo.toml` (public API expansion).
- README substantially expanded (Trend Analysis, Advanced Temporal & Pixelwise Processing).
- CI workflow (`.github/workflows/ci.yml`) updated to reflect new build/test/documentation steps.
- Benchmarks: default array sizes reduced (performance commit) to speed up CI runtime.
- `scripts/benchmark.py` updated (array size reduction & processes integration).
- Makefile updated to ensure docs build integration.
- Expanded `lib.rs` registrations for new temporal, processes, and trend functions.

### Fixed
- Corrected EPSILON comments and baseline variable initialization in `scripts/benchmark.py`.
- Cleaned repository of prior unwanted documentation build artifacts; updated `.gitignore` to prevent re-adding.
- Improved consistency of moving average NaN handling across dimensional dispatch paths.

### Performance
- Moving average & strided moving average use prefix-sum (O(T) per pixel independent of window size).
- Parallelization (Rayon) applied to 3D/4D temporal reducers and processes for better multi-core throughput.
- Reduced benchmark array dimensions accelerate CI without altering algorithmic complexity.
- Strided temporal moving average reduces output temporal length → downstream memory & compute savings.

### Docs
- Added full per-function Sphinx reference pages (indices, temporal, masking, processes, trends).
- README new sections: Trend Analysis; Advanced Temporal & Pixelwise Processing.
- Benchmark and distribution documentation pages added.
- GitHub Pages static deployment pipeline documented.
- Clarified temporal dimensionality (1D–4D) for new processes in docs.

### Internal
- New modules integrated: `processes`, `trends`; extended `lib.rs` for bindings.
- Added weighted temporal compositing (`temporal_composite`) for 4D stacks.
- Added linear regression helper function to support trend residual analysis.
- Extended test suite: `tests/test_processes.py`, `tests/test_processes_stride.py` (stride sampling correctness, NaN semantics).
- Updated type stubs (`__init__.pyi`) to include new processes (though version literal not yet bumped—see Notes).

### Removed
- `architecture/ADR-template.md` (deprecated placeholder file).
- Legacy generated doc build artifacts removed from version control (now ignored).

### Notes
- Stub & Python `__version__` remain at `"0.6.0"`; requires follow-up patch to synchronize with `0.7.0`.
- Next patch should update `python/eo_processor/__init__.py` and `__init__.pyi` version literals and add a changelog "Fixed" entry for version sync.
- No breaking changes; all new APIs are additive → SemVer minor release justified.
- Trend analysis UDF is iterative and may require future optimization for very large series; current implementation favors clarity over advanced segmentation heuristics.

---
## [0.6.0] - 2025-11-12
Patch release (documentation workflow, stub corrections, version sync).

### Added
- Sphinx documentation pipeline (Furo theme, MyST Markdown, autosummary, napoleon, intersphinx) with `architecture` page and autosummary-driven function index.
- Read the Docs configuration (`.readthedocs.yaml`) enabling hosted builds.
- Injected high-level Rust acceleration note (GIL release, float64 coercion, parallel thresholds) via `conf.py`.

### Changed
- Type stubs (`__init__.pyi`): updated `__version__` literal from "0.4.0" to "0.6.0"; added detailed dimensionality notes (1D–4D dispatch, delta indices limited to 1D/2D, distance functions 2D only).
- Expanded `composite()` docstring to formalize method semantics and future extensibility guidance.
- Architecture documentation elaborated on memory efficiency, NaN handling, and parallel strategy.

### Fixed
- Version synchronization across `pyproject.toml`, `Cargo.toml`, and `python/eo_processor/__init__.py` (all now 0.6.0).
- Eliminated mismatch that previously showed stale version in type stubs.
- Ensured autosummary list fully reflects current public API (including delta indices and masking utilities).

### Docs
- README: Added Read the Docs badge; clarified performance philosophy & benchmark usage.
- New Sphinx pages: `architecture` (performance model & extensibility) and consolidated index with autosummary of all functions.
- Clarified dimensional dispatch (1D–4D) and NaN skip behavior in temporal & masking functions.
- Cross-linked contribution, security, and agent governance documents from Sphinx index.

### Internal
- `conf.py`: automatic inclusion of `README.md` and `QUICKSTART.md` into docs source; mock import of compiled extension for RTD builds; injected `rust_arch_note`.
- CI: Documentation build job (artifact upload + reference validation) integrated to catch broken links or autodoc issues.
- Governance (`AGENTS.md`, copilot instructions): reinforced mandatory doc updates for any public API or performance claim.

### Performance
- No new kernels; benchmarks unchanged. Existing claims retained (no modified speedup statements).

### Removed
- None.

### Notes
- Future feature additions (new indices or compositing methods) will require minor version bump per SemVer.
- Patch classification chosen because changes are confined to documentation, metadata, and non-breaking stub/doc improvements.


## [0.4.0] - 2025-11-10
Minor release (new non-breaking features).

### Added
- Change detection (delta) spectral indices:
  - `delta_ndvi(pre_nir, pre_red, post_nir, post_red)`
  - `delta_nbr(pre_nir, pre_swir2, post_nir, post_swir2)`
  Implemented in Rust with 1D/2D shape dispatch and Python bindings.
- Integrated `delta_ndvi` and `delta_nbr` into the benchmark harness (spectral group, NumPy baseline formulas included).
- Markdown + JSON benchmark reporting now includes new indices automatically.
- Type stub expansion:
  - Introduced `NumericArray` alias so all index & temporal function inputs accept any numeric dtype (int/uint/float); outputs remain `float64`.
- Baseline NumPy implementations for delta indices in benchmarking to report Rust speedups.

### Changed
- Broadened stubs (`__init__.pyi`) from strict `NDArray[np.float64]` inputs to generic numeric arrays (reflecting runtime coercion).
- Benchmark script refactored for clearer function set resolution and throughput accounting for new functions.

### Fixed
- Minor layout / alignment adjustments in coverage badge pipeline (ensuring consistent rendering when regenerated).
- Static analysis noise reduced in benchmark harness (broader callable typing).

### Docs
- README: Added delta index formulas and interpretation notes; clarified dtype coercion note.
- Extended API summary table with change detection indices.

### Internal
- Added synthetic pre/post event generation paths in benchmark harness (seed offset technique) for deterministic delta benchmarking.

---

## [0.3.0]
Minor release (feature expansion & robustness).

### Added
- New spectral indices: `savi` (variable L), `ndmi`, `nbr2`, `gci`.
- Spatial distance functions (pairwise matrices): `euclidean_distance`, `manhattan_distance`, `chebyshev_distance`, `minkowski_distance` (parallelized internally for large workloads).
- Command-line tool `scripts/eo_cli.py` for batch index computation (supports masking, PNG previews, and multi-index runs).
- Comprehensive dtype coercion: all spectral & temporal functions now accept any numeric NumPy dtype (coerced to float64 internally).
- Expanded temporal utilities: `median`, `temporal_mean`, `temporal_std`, plus `composite` convenience wrapper (median).
- Initial benchmark harness (spectral, temporal, distance groups) with optional NumPy baseline comparison.
- Coverage badge generation script integration in CI.

### Changed
- Unified error handling with clearer shape mismatch messages.
- Improved internal shape dispatch for 1D/2D spectral kernels.
- Streamlined README structure (formulas, typical value ranges, interpretation guidance).

### Docs
- Added formula reference section for new indices.
- Usage examples for CLI, XArray/Dask integration, and performance notes.

### Tests
- Added tests for new indices, dtype coercion paths, and edge cases (near-zero denominators, shape validation).

---

## [0.2.0]
Minor release (extended analytics & performance groundwork).

### Added
- Enhanced Vegetation Index: `enhanced_vegetation_index` (alias `evi`).
- Normalized Burn Ratio: `nbr`.
- Temporal statistics: initial implementations of median / mean / std across leading time axis.
- Convenience `normalized_difference` generalized function.
- Early performance benchmarking script (spectral focus).
- Initial documentation of typical spectral index ranges.

### Changed
- Refined Rust module layout for clearer separation of spectral vs temporal kernels.
- Improved denominator guarding logic for stability.

### Docs
- Added interpretation ranges (e.g., NDVI vegetation thresholds).
- Quick start examples expanded.

### Tests
- Added property-style tests to ensure outputs remain within expected numeric bounds (-1..1 where applicable).

---

## [0.1.0]
Initial public release.

### Added
- Core Rust + PyO3 packaging & build pipeline.
- Spectral indices: `ndvi`, `ndwi`.
- Generic normalized difference pattern embedded in early kernels.
- Basic temporal dimension handling groundwork.
- Initial test suite (shape correctness, basic numerical validation).
- Continuous Integration: build & test matrix; wheel build scaffolding.
- README with installation instructions and quick start.

---

## Future (Unreleased / Roadmap)
(Subject to discussion; not yet scheduled)
- Additional indices (e.g., SAVI variants with adaptive L, more chlorophyll / moisture metrics).
- Auto-tuning of parallel distance threshold.
- Cloud masking + compositing higher-level helper.
- Extended change detection suite (delta for additional indices).
- Optional benchmark automation in CI with historical trend tracking.

---

## Versioning Notes
- Patch versions reserved for bug fixes / internal refactors.
- Minor versions introduce new backward-compatible functions or performance improvements.
- Major versions will be used for any breaking API changes (renames, signature alterations).

---

## Attribution
See repository history and commit messages for detailed authorship and rationale behind each change.
