]> Piment Noir Git Repositories - freqai-strategies.git/commit
refactor(quickadapter): extract is_finite_number to Utils and reuse it (#122)
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 23 Jul 2026 19:25:54 +0000 (21:25 +0200)
committerGitHub <noreply@github.com>
Thu, 23 Jul 2026 19:25:54 +0000 (21:25 +0200)
commit4dbadf96b16353579bf53dfc47b21511d3d493d8
tree7b8a2d5fc8156e673085ba30734a964eaafc6d70
parentbccb1c3e7d5232e462ce3e6f6b8612cacfb34ca2
refactor(quickadapter): extract is_finite_number to Utils and reuse it (#122)

* refactor(quickadapter): extract is_finite_number to Utils and reuse it

- move the numeric/finite/non-bool scalar guard from a QuickAdapterV3
  static method to a shared Utils.is_finite_number helper
- reuse it across the strategy label getters/setters and the shared
  label_natr_multiplier validation guard
- leave the strict positive-int label_period_candles/label_horizon_candles
  paths unchanged (distinct predicate)

* refactor(quickadapter): harden label-param fallbacks and per-row NATR guard

Address the #112 re-review findings (landed in this PR):
- coerce the per-row label_period_candles series with pandas to_numeric
  before np.isfinite, matching the guarded scalar path (object/str dtype no
  longer raises)
- re-validate the persisted _label_params fallback in the label getters via
  is_finite_number before use, otherwise fall back to config
- generalize the is_trade_runmode comment (it gates both persisted-param
  reuse and per-candle param setting)
- README: drop the inaccurate 'simulated' wording and the runmode-specific
  framing on the label_period_candles/label_natr_multiplier rows

* docs(quickadapter): drop per-candle label-param behavior notes from tunables

The label_period_candles/label_natr_multiplier rows describe labeling
tunables; the per-candle strategy-NATR/exit consumption is an internal
behavior detail (already documented inline in the code), not needed to
configure the tunable. Revert both rows to their base description.

* style(quickadapter): wrap set_label_natr_multiplier guard per ruff format

The committed one-liner exceeded the 88-char line length; apply ruff
format wrapping (behavior unchanged).

* docs(quickadapter): align warm_start tunable row padding

Trim one over-pad space so the warm_start row matches the surrounding table column width (whitespace only).
README.md
quickadapter/user_data/strategies/QuickAdapterV3.py
quickadapter/user_data/strategies/Utils.py