Skip to content

v6.4.2 — Pine-compatible NA semantics & typing overhaul

Latest

Choose a tag to compare

@wallneradam wallneradam released this 10 Apr 19:24
· 1 commit to main since this release

Highlights

  • Pine-compatible NA semantics for division by zero — introduces valued NA singletons (na_inf, na_neg_inf, na_nan) so that safe_div no longer collapses zero-denominator results to plain NA. Comparisons and arithmetic now follow IEEE-754 (e.g. inf > 40 is true) while isinstance(x, NA) and na() still report them as NA, matching Pine's dual semantics. Fixes user-level expressions like dropPercent > 40 silently breaking on zero denominators.
  • Systematic typing overhaul — new PyneFloat / PyneInt / PyneStr / PyneBool type aliases and a type_checker compatibility layer that satisfies PyCharm and pyright simultaneously. Tightens annotations across 78 files covering CLI, core engine, transformers, library functions, strategy subsystem and providers, plus new .pyi stubs for NA, Series, session and type_checker.

Features

  • dayofweek is now a callable module property with weekday constants and typing support, registered via the module property collector and loaded at package import time. timenow is also exposed in lib exports.

Fixes

  • Transformers: self-named submodule properties are now promoted to the parent module by the property collector, and the regenerated module_properties.json includes the previously missing strategy properties and library members.
  • Strategy stats: commission total is now cast to float to avoid type drift in aggregated statistics.
  • NA arithmetic return types propagate correctly; is_na now also recognizes native float inf / nan as a safety net for externally sourced values.
  • Matrix operand handling with NA values, SequenceView slice-assignment typing, strategy trade metadata normalization, security shared memory buffer typing and syminfo analyst target defaults — all corrected as part of the typing overhaul.
  • Docs: stray character removed from the script format metadata reference.

Tests

  • New unit tests for valued NA singletons and safe_div semantics covering identity/isinstance invariants, IEEE-754 comparisons and arithmetic on na_inf/na_neg_inf/na_nan, plain NA backwards compatibility, safe_div zero-denominator dispatch, is_na predicate on both valued and native float inf/nan, and a ta.*-style isinstance guard regression check.