Skip to content

Add moving-average smoothing (SMA / WMA / EWMA / rolling)#310

Merged
JE-Chen merged 1 commit into
devfrom
feat/smoothing-batch
Jun 22, 2026
Merged

Add moving-average smoothing (SMA / WMA / EWMA / rolling)#310
JE-Chen merged 1 commit into
devfrom
feat/smoothing-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 22, 2026

Copy link
Copy Markdown
Member

What

stats.describe summarizes a whole sample and timeseries rolls counters into rates, but nothing smoothed a noisy signal.

  • sma(values, window) / wma(values, weights) / ewma(values, *, alpha) — trailing moving averages.
  • rolling(values, window, func) — generic trailing-window reduction.

All return a same-length list aligned to the input timeline.

Layers

  • Headless core: utils/smoothing/ (pure stdlib, zero PySide6).
  • Facade: 4 symbols + __all__.
  • Executor: AC_sma, AC_ewma.
  • MCP: ac_sma, ac_ewma (read-only).
  • Script Builder: both under Data.
  • Tests: test/unit_test/headless/test_smoothing_batch.py (8 tests).
  • Docs: v102_features_doc.rst (EN + Zh) + toctrees + 3 README What's-new sections.

Verification

  • pytest → 8 passed; ruff/pylint 10.00/bandit/radon clean; Qt-free.

stats.describe summarises a whole sample and timeseries rolls counters
into rates, but nothing smoothed a noisy signal or weighted recent points.
Add trailing simple / weighted / exponentially-weighted moving averages
and a generic rolling reducer, each returning a same-length list aligned
to the input timeline. Wired through facade, executor (AC_sma / AC_ewma),
MCP, and the Script Builder with a headless test batch and EN/Zh docs.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 31 complexity · 0 duplication

Metric Results
Complexity 31
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 8dbc7d3 into dev Jun 22, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/smoothing-batch branch June 22, 2026 00:24
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant