682bf063ca
Prepare the first patch release after v1.0.0 by finalizing the outstanding release, packaging, and workflow fixes. This release keeps PyPI and crates.io publishing anchored to CI.yml, splits the large CI workflow into focused rust/python/wasm/docs suites, fixes the ci-complete gate, and updates the release SBOM action pin. It also switches the npm publish workflow to GitHub OIDC, installs the wasm32 target required for packaging, ensures the WASM npm tarball includes pkg/ artifacts during prepack, and adds a dedicated README plus docs.rs metadata for ferro_ta_core. Finally, bump all published package versions to 1.0.1 and record the patch release notes in CHANGELOG.md.
19 KiB
19 KiB
Changelog
All notable changes to ferro-ta are documented in this file.
The format follows Keep a Changelog and the project uses Semantic Versioning.
Unreleased
1.0.1 — 2026-03-24
Added
crates/ferro_ta_core/README.mdis now shipped with the published Rust crate, andferro_ta_coremetadata now points documentation to docs.rs.
Fixed
- CI has been modularized into focused workflow files (
ci-rust.yml,ci-python.yml,ci-wasm.yml,ci-docs.yml) while keeping the release publishing jobs inCI.ymlfor PyPI and crates.io trusted-publisher compatibility. - The
ci-completegate no longer fails successful runs because of an escaped shell variable, and the release SBOM job now uses a validanchore/sbom-actionversion. - The npm publish workflow now uses GitHub OIDC trusted publishing, installs
the
wasm32-unknown-unknowntarget, and no longer depends on anNPM_TOKENsecret. - The WASM npm package now removes the generated
pkg/.gitignoreduringprepack, so the published tarball includes the builtpkg/artifacts.
1.0.0 — 2026-03-23 (initial stable release)
Performance
- SMA/EMA (
src/overlap/sma.rs,src/overlap/ema.rs): Replaced per-barta::SimpleMovingAverage/ta::ExponentialMovingAveragestate-machine objects withferro_ta_core::overlap::sma(O(n) sliding-window sum) andferro_ta_core::overlap::ema(O(n) recurrence). SMA/EMA now run at 200–600 M bars/s on 1 M input. - WMA (
crates/ferro_ta_core/src/overlap.rs,src/overlap/wma.rs): Replaced O(n × period) double-loop with an O(n) incremental algorithm using running weighted sumT[i] = T[i-1] + n·close[i] - S[i-1]and sliding sumS. ~10× speedup vs previous implementation for large periods. - BBANDS (
crates/ferro_ta_core/src/overlap.rs,src/overlap/bbands.rs): Replaced O(n × period) per-window variance with O(n) slidingsumandsum_sqaccumulators (var = sum_sq/n - mean²). ~10× speedup. - MACD (
crates/ferro_ta_core/src/overlap.rs,src/overlap/macd.rs): Replacedta::MovingAverageConvergenceDivergenceper-bar object with a pure-Rust implementation. Fast and slow EMAs now advance in a single combined loop to minimise allocation and memory round-trips. - MFI (
src/momentum/mfi.rs): Removed per-barta::DataItem::builder().build()allocation. Replacedta::MoneyFlowIndexwithferro_ta_core::volume::mfi— a direct O(n) sliding-window implementation on raw high/low/close/volume slices. ~5× speedup. - batch_sma / batch_ema (
src/batch/mod.rs): Batch functions now delegate toferro_ta_coreO(n) implementations instead of constructing per-bartaindicator objects.
Fixed
- Rust clippy: Removed dead code
compute_emafunction fromsrc/extended/mod.rs. - fuzz/Cargo.toml: Added
[workspace]table to prevent cargo workspace detection error (same fix aswasm/Cargo.toml). - Python lint: Replaced deprecated
typing.Dict/List/Tuple/Typewith built-in equivalents across 21 Python files (ruff UP035). - Type checking (mypy): Fixed
_normalize_rust_errorreturn type toNoReturn; fixed type errors in_utils.py,crypto.py,chunked.py,regime.py,features.py,dsl.py,mcp/__init__.py. - Type checking (pyright): Set
reportMissingImports = falseto handle Rust extension and optional deps; fixedgpu.pycupy handling withAnytype annotation. - Sphinx docs: Fixed RST title underline lengths; fixed unexpected indentation in
plugins.rst; fixed invalid:doc:references inindex.rstandcontributing.rst. - Sphinx autodoc: Fixed
conf.pyto not overridesys.pathwhen the wheel is installed; addedsuppress_warningsfor autodoc import failures. - CI test coverage: Added
pandas,polars,hypothesis,pyyamlto CI test dependencies; coverage threshold adjusted from 80% to 65% (up from failing 59%). - Exception hierarchy: All
FerroTAErrorsubclasses now acceptcodeandsuggestionkeyword arguments; validation helpers (check_timeperiod,check_equal_length,check_finite,check_min_length) populate error codes and actionable suggestion hints.
Added
- Dependabot: Added
.github/dependabot.ymlfor weekly automated dependency updates (Python, Rust, GitHub Actions). - Error codes: Every
FerroTAErrorexception now carries a short code (e.g.FTERR001–FTERR006) for programmatic handling; seeferro_ta.exceptions.ERROR_CODES. - Observability / Logging (
ferro_ta.logging_utils): New module withenable_debug(),disable_debug(),debug_mode()context manager,log_call(),benchmark(), andtraced()decorator. Re-exported from theferro_tanamespace. - API discovery (
ferro_ta.api_info): Newferro_ta.indicators(category=None)function listing all 160+ indicators with metadata;ferro_ta.info(func)returning signature, docstring and parameter info. Re-exported from theferro_tanamespace. - Developer experience: Added
Makefilewithmake dev/build/test/lint/fmt/typecheck/docs/bench/audit/cleantargets; added.devcontainer/devcontainer.jsonfor zero-friction VS Code/Codespaces onboarding; addedTROUBLESHOOTING.mdfor common build issues. - Security: Added
deny.tomlforcargo-denylicense and advisory checking. - Test fixtures: Added
tests/fixtures/ohlcv_daily.csv(252-bar synthetic OHLCV dataset); addedtests/test_integration.pywith end-to-end indicator tests on the fixture.
Changed
- Python 3.10 minimum: Dropped support for Python 3.8 and 3.9.
requires-pythonis now>=3.10so optional dependencies (e.g.mcp) resolve correctly with uv/pip. CI, docs, PLATFORMS.md, VERSIONING.md, CONTRIBUTING.md, and conda recipe updated accordingly.
Added — Rust-first migration: streaming, extended indicators, math operators
- Rust streaming classes (
src/streaming/mod.rs): All 9 streaming classes (StreamingSMA,StreamingEMA,StreamingRSI,StreamingATR,StreamingBBands,StreamingMACD,StreamingStoch,StreamingVWAP,StreamingSupertrend) are now PyO3#[pyclass]types compiled into_ferro_ta. Zero Python overhead for bar-by-bar updates in live-trading use. Pythonstreaming.pyre-exports the Rust classes from the_ferro_taextension; there is no Python fallback (the extension must be built). - Rust extended indicators (
src/extended/mod.rs): All 10 extended indicators (VWAP, SUPERTREND, DONCHIAN, ICHIMOKU, PIVOT_POINTS, KELTNER_CHANNELS, HULL_MA, CHANDELIER_EXIT, VWMA, CHOPPINESS_INDEX) now compute entirely in Rust. The SUPERTREND sequential band-adjustment loop, DONCHIAN/CHANDELIER rolling max/min, and CHOPPINESS_INDEX rolling window are now O(n) monotonic deque operations in Rust — no Python loops remain. - Rust rolling math operators (
src/math_ops/mod.rs):rolling_sum,rolling_max,rolling_min,rolling_maxindex,rolling_minindex— all using O(n) prefix-sum or monotonic deque algorithms. PythonSUM,MAX,MIN,MAXINDEX,MININDEXinmath_ops.pynow delegate to Rust. docs/rust_first.md: New Rust-first architecture policy document. Defines the Python/Rust boundary, porting rules, forbidden patterns, a checklist for new indicator PRs, and a status table of all modules.ferro_ta.rawexpanded: Added streaming classes (StreamingSMA, …), extended indicator functions (supertrend,donchian,vwap, …), and rolling math operators (rolling_sum,rolling_max, …) toraw.py.docs/index.rst: Added link todocs/rust_first.md.
Added — Rust batch API, raw submodule, stability docs, and production polish
- Rust batch API: Added
src/batch/mod.rswithbatch_sma,batch_ema,batch_rsiRust functions that accept 2-D numpy arrays and process all columns in a single Rust call (one GIL release for all columns). Eliminates the per-column Python round-trip in the previous implementation. - Python batch fast path:
ferro_ta.batch.batch_sma/ema/rsicall the Rust batch functions for 2-D input (no Python fallback; extension required). The genericbatch_applyremains for arbitrary indicators that do not have a Rust batch implementation. ferro_ta.rawsubmodule: Newpython/ferro_ta/raw.pythat re-exports all compiled Rust functions without pandas/polars wrapping, validation, or_to_f64conversion. Use when you have pre-converted float64 arrays and need minimal overhead. Includes the newbatch_sma/ema/rsiRust functions.docs/stability.md: New API stability policy document: stable vs experimental tiers, versioning table, deprecation policy (keep deprecated name for ≥1 minor release withDeprecationWarning).docs/plans/2026-03-08-production-grade.md: Implementation plan tracking all parts of the production-grade plan with status and commit references.ndarraydependency: Addedndarray = "0.16"toCargo.tomlto support 2-D array operations in the batch Rust module.docs/index.rst: Added link todocs/stability.md.- CONTRIBUTING.md: Added uv-based development workflow as the recommended setup path; pip-based alternative preserved for users who prefer it.
- RELEASE.md: Added security audit step (
cargo audit+pip-audit) to pre-release checklist; added CHANGELOG completeness requirement.
Added — Performance, uv, CI improvements, and architecture docs
_to_f64fast path: 1-D C-contiguousfloat64NumPy arrays are returned as-is (zero copy/allocation) instead of always callingnp.ascontiguousarray.- polars zero-copy result:
polars_wrapnow buildspl.Seriesfrom the NumPy buffer viapl.Series(name, np.asarray(result))instead of the O(n).tolist()path, improving polars throughput for all indicators. - uv project manager support: Added
[tool.uv]section topyproject.tomlwithdev-dependencies; added adevextra to[project.optional-dependencies]. Development workflow:uv sync --extra devthenuv run pytest tests/. - CI — separate optional jobs: Rust tarpaulin coverage moved to a dedicated
rust-coveragejob (markedcontinue-on-error: trueat job level, not step level); fuzz job similarly isolated. All required CI steps are in blocking jobs. Thecontinue-on-errorflag is no longer scattered across individual steps, making failures visible in the CI summary. - CI — uv in lint/typecheck/audit:
lint,typecheck, andauditjobs install uv and run tools viauv run --with <tool>. - Docs —
docs/architecture.md: New document describing the two-crate Rust layout, Python binding flow, module table, packaging details, and where validation lives. - Docs —
docs/performance.md: New guide covering the fast path for contiguous arrays, raw_ferro_taAPI, pandas/polars overhead, batch limitations, streaming characteristics, and practical tips. - Docs —
docs/index.rst: Added links to architecture and performance docs.
Added — Production-grade hardening (validation, CI, docs)
- Validation: All Python indicator wrappers now call
check_timeperiod()andcheck_equal_length()where applicable and re-raise RustValueErrorasFerroTAValueError/FerroTAInputErrorvia_normalize_rust_error(). New helpercheck_min_length()inferro_ta.exceptions. - CI: Coverage gate (pytest
--cov-fail-under=80), lint job (ruff check + format), pyright in typecheck job, CHANGELOG check for PRs, audit and fuzz no longer usecontinue-on-error. - Docs:
docs/error_handling.rst,docs/api/exceptions.rst, CONTRIBUTING updated for modular Rust layout (src/pattern/mod.rs+ per-pattern files), SphinxreleasefromFERRO_TA_VERSIONenv. - Tests:
tests/test_validation.py(invalid timeperiod, mismatched lengths, empty/short arrays, exception inheritance),tests/test_property_based.py(Hypothesis), hypothesis optional dependency. - Tooling: Ruff and pre-commit config (
.pre-commit-config.yaml), mypywarn_return_any = true, pyright in CI, RELEASE.md and SECURITY.md updated.
Added — TA-Lib numerical parity documentation
- Added MAMA, SAR/SAREXT, and all HT_* tests to
tests/test_vs_talib.pywith documented justification for each remaining "Corr/Shape" difference. issues/Stages1-10.mdcreated with known-difference table for MAMA, SAR, SAREXT, HT_DCPERIOD, HT_DCPHASE, HT_PHASOR, HT_SINE, HT_TRENDLINE, HT_TRENDMODE.
Added — Pure Rust core library
- New Cargo workspace: root
Cargo.tomldeclares workspace members[".","crates/ferro_ta_core"]. crates/ferro_ta_core— pure Rust library crate with no PyO3/numpy dependency.- Core modules:
overlap(SMA/EMA/WMA/BBANDS),momentum(RSI/MOM),volatility(ATR/TRANGE),volume(OBV),statistic(STDDEV),math(SUM/MAX/MIN). cargo test -p ferro_ta_corepasses (12 tests).- CI
rust-corejob:cargo build -p ferro_ta_core && cargo test -p ferro_ta_core. - README and CONTRIBUTING describe the two-layer architecture.
Added — Batch execution API
- New
ferro_ta.batchmodule:batch_sma,batch_ema,batch_rsi,batch_apply. - Accepts 2-D
(n_samples × n_series)arrays; returns same shape. - 1-D input falls back to single-series behaviour (backward compatible).
- Exported from
ferro_ta.__init__; documented indocs/batch.rst.
Added — Documentation CI
- New CI job
docs: installs Sphinx + ferro_ta, runssphinx-build -b html docs docs/_build -W. docs/batch.rstanddocs/api/batch.rstadded; linked fromdocs/index.rst.- Feature list in
docs/index.rstupdated to mention batch API and Rust core.
Added — Rust coverage
- CI
rustjob installscargo-tarpaulinand collects XML coverage forferro_ta_core. - Coverage artifact
rust-coverageuploaded per-run. - CONTRIBUTING updated with
cargo tarpaulininstructions.
Added — Community governance (issues/ directory)
issues/Stages1-10.md— full issue text for stages 1–10 (linked from ROADMAP.md).issues/Stages11-20.md— stage overview for stages 11–20.
Added — Release and versioning playbook
RELEASE.md— step-by-step release playbook (version bump → CHANGELOG → tag → PyPI verify).- CI
version-checkjob: fails ifCargo.tomlandpyproject.tomlversions diverge. CONTRIBUTING.mdupdated with release process, changelog policy, and fuzzing instructions.
Added — Optional GPU backend (PyTorch)
ferro_ta.gpumodule:sma,ema,rsi— GPU-accelerated when PyTorch is available.ferro_ta[gpu]optional extra inpyproject.toml.docs/gpu-backend.md— design doc with scope, limitations, and benchmark table.benchmarks/bench_gpu.py— CPU vs GPU benchmark script.
Added — WASM binding expansion
- WASM
macd()added towasm/src/lib.rs(7 indicators total). - CI WASM job builds package and uploads
wasm-pkgartifact. wasm/README.mdupdated with Node.js + browser examples and CI artifact docs.
Added — Fuzzing and robustness
fuzz/directory with cargo-fuzz targets for SMA and RSI.- CI
fuzzjob: nightly Rust, 1000 iterations per target, uploads crash artifacts. - Fuzzing instructions added to
CONTRIBUTING.md.
Added — Indicator pipeline / composition API
ferro_ta.pipelinemodule:Pipelineclass,make_pipelinefactory.- Chain multiple indicators; results returned as a named dictionary.
- Supports multi-output indicators (BBANDS, MACD) via
output_keys.
Added — Polars integration
- Transparent
polars.Seriessupport viapolars_wrapdecorator in_utils.py. ferro_ta[polars]optional extra inpyproject.toml.- Polars Series in → Polars Series out; NumPy path unchanged.
Added — Configuration and defaults management
ferro_ta.configmodule:set_default,get_default,get_defaults_for,reset,list_defaults.Configcontext manager for temporary parameter overrides.- Thread-local storage — safe for concurrent tests.
Added — Additional WASM indicators
- WASM
mom()(Momentum) andstochf()(Fast Stochastic) added (9 indicators total). - Tests for both new indicators in
wasm/src/lib.rs. wasm/README.mdupdated with expanded indicator table.
Added — Jupyter notebook examples
examples/quickstart.ipynb— core API tour (SMA, RSI, MACD, BBANDS, batch, pipeline, pandas).examples/streaming.ipynb— streaming bar-by-bar API demonstration.examples/backtesting.ipynb— backtesting harness, pipeline feature engineering, config defaults.examples/README.md— index of all notebooks with run instructions.
Added — v1.0 preparation and API stability
VERSIONING.mdupdated with API stability guarantees and compatibility matrix.ROADMAP.mdupdated: stages 15–20 marked Done.- README updated with Pipeline, Polars, and Config API sections.
Added — Alternative language bindings (WASM)
- New
wasm/directory: WebAssembly bindings viawasm-bindgen/wasm-pack. - Exposes
sma,ema,bbands,rsi,atr,obvfor Node.js and browsers. wasm/README.md— build & usage instructions;wasm/package.json.- CI job
wasmbuilds and tests the WASM crate withwasm-pack test --node.
Added — Distribution & packaging maturity
- Python 3.13 added to CI test matrix.
conda/meta.yaml— Conda recipe for conda-forge / local channel builds.- Supported platforms documented in
PLATFORMS.md.
Added — Type stubs & typing
python/ferro_ta/py.typedmarker added (PEP 561 compliance).pyproject.toml[tool.mypy]section added for IDE / CI use.Typing :: TypedPyPI classifier present inpyproject.toml.
Added — Error model & validation
ferro_ta.exceptionsmodule:FerroTAError,FerroTAValueError,FerroTAInputError.- Validation helpers:
check_timeperiod,check_equal_length,check_finite. - All three exception classes exported from
ferro_tatop-level namespace.
Added — Backtesting utilities
ferro_ta.backtestmodule:backtest()entry point,BacktestResultcontainer.- Built-in strategies:
rsi_strategy(RSI 30/70) andsma_crossover_strategy. - Clear scope note: "minimal harness for testing strategies."
Added — CI/CD & quality expansion
pytest-covcoverage reporting added to CI (testsjob); coverage XML uploaded.CHANGELOG.md(this file).VERSIONING.md— semantic versioning policy and release playbook.
Added — Plugin / extension system
ferro_ta.registrymodule:register,unregister,get,run,list_indicators.- All built-in indicators auto-registered at import time.
FerroTARegistryErrorraised for unknown indicator names.