feat(c-abi): expose warmup_period / is_ready across the C ABI bindings (#297)

* feat(c-abi): expose warmup_period / is_ready across the C ABI bindings

The C ABI hub exposed new/update/batch/reset/free per indicator but not the
Indicator::warmup_period / is_ready queries that the native (Python/Node/WASM)
bindings already had, so C/C#/Go/Java/R callers could not ask an indicator
whether it was warmed up without feeding it and watching for NaN.

Regenerated from the ScriptHelpers capi + language generators:
- bindings/c: wickra_<ind>_warmup_period (size_t) and wickra_<ind>_is_ready
  (bool) for every indicator (504; the 10 alt-chart bar builders are excluded
  by design). wickra.h regenerated via cbindgen (additive only).
- bindings/csharp: int WarmupPeriod() / bool IsReady() on each wrapper.
- bindings/go: WarmupPeriod() int / IsReady() bool.
- bindings/java: int warmupPeriod() / boolean isReady().
- bindings/r: C glue + registration; hand-written warmup_period() / is_ready()
  S3 generics in methods.R, plus NAMESPACE exports.

Tests: C-ABI Rust unit tests, the C examples/archetypes.c suite, and the C#,
Go, Java and R archetype suites all gain a warmup/is_ready transition check.

* build(go): sync vendored wickra.h with the C ABI header

The Go binding vendors bindings/c/include/wickra.h; refresh it with the new
warmup_period / is_ready declarations so the CI sync check passes.
This commit is contained in:
kingchenc
2026-06-14 01:04:06 +02:00
committed by GitHub
parent d9e6807ca0
commit 0c925aa9d5
520 changed files with 54766 additions and 56 deletions
+17
View File
@@ -151,6 +151,23 @@ int main(void) {
/* 9. A NULL handle update is a no-op returning NaN, never a crash. */
CHECK(is_nan(wickra_sma_update(NULL, 1.0)), "update(NULL) should return NaN");
CHECK(wickra_sma_warmup_period(NULL) == 0, "warmup_period(NULL) should be 0");
CHECK(!wickra_sma_is_ready(NULL), "is_ready(NULL) should be false");
/* 10. warmup_period / is_ready report the warmup transition. */
{
struct Sma *sma = wickra_sma_new(3);
CHECK(wickra_sma_warmup_period(sma) == 3, "SMA(3) warmup_period should be 3");
CHECK(!wickra_sma_is_ready(sma), "SMA is not ready before any update");
wickra_sma_update(sma, 1.0);
wickra_sma_update(sma, 2.0);
CHECK(!wickra_sma_is_ready(sma), "SMA is not ready mid-warmup");
wickra_sma_update(sma, 3.0);
CHECK(wickra_sma_is_ready(sma), "SMA is ready after the warmup period");
wickra_sma_reset(sma);
CHECK(!wickra_sma_is_ready(sma), "SMA is not ready after reset");
wickra_sma_free(sma);
}
if (failures == 0) {
printf("all archetypes passed\n");