Skip to content

Restore call parameters when an abstract call fails - #779

Merged
mario4tier merged 2 commits into
devfrom
fix-194-call-restore
Oct 24, 2026
Merged

mario4tier merged 2 commits into
devfrom
fix-194-call-restore

Conversation

@mario4tier

@mario4tier mario4tier commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #195, refs #194. A Function call that raised skipped the restore of the parameters and price names passed to it, so they stuck: after abstract.SMA(d, timeperiod=0) failed, abstract.SMA(d) failed too. The restore now runs in a finally. set_parameters also checks every value before writing any, so a rejected call leaves the function as it was. Calls that succeed behave as before.

The second commit regenerates _ta_lib.c with make cython (Cython 3.3.0), which also picks up #778. Against C dev 2af42bf84, built from the .pyx and again from the regenerated .c: 1714 passed, 1 skipped; both new tests fail without the _abstract.pxi hunk.

A Function call that raised skipped the restore of the parameters and
price names it was given, so they stuck and the next call used them:
after abstract.SMA(d, timeperiod=0) failed, abstract.SMA(d) failed too.
Restore them on every path. set_parameters also checks every value before
writing any, so a rejected call leaves the function as it was.

Refs #194
`make cython` from the repo root, with Cython 3.3.0 and numpy 2.5.4 in
.venv (python3.12). Built from this file without Cython: 1714 passed,
1 skipped.
@mario4tier
mario4tier merged commit e99439a into dev Oct 24, 2026
7 checks passed
@mario4tier
mario4tier deleted the fix-194-call-restore branch October 24, 2026 17:44
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