Repository navigation
Make abstract API more flexible with int->double support - #780
Merged
Merged
Conversation
This was referenced Oct 24, 2026
Merged
A real parameter now takes any real number, an int or a numpy integer or float included, and an integer parameter any integer, a numpy integer included, as talib.func does: abstract.BBANDS(d, 20, 2, 2) raised "expected float, got int". A value of a newly accepted kind is stored converted to float or int; a value accepted before is stored as given. A value of another kind, a float for an integer parameter included, still raises TypeError. Closes #430
mario4tier
force-pushed
the
fix-430-numeric-params
branch
from
October 25, 2026 19:08
3c746c6 to
8448b84
Compare
Member
|
Sounds great. When the dev branch is ready, lets merge it into main for the release against 0.8.3 C library |
Member
Author
|
This is now on dev-v0.8.3 which is ready for your review/merge to main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #430. An abstract function now takes any number of a parameter's kind, as
talib.funcdoes:abstract.BBANDS(d, 20, 2, 2)(the example in docs/abstract.md) raised "expected float, got int", andabstract.SMA(d, timeperiod=np.int64(10))raised "expected int, got int64". A real parameter takes anynumbers.Realand an integer parameter anynumbers.Integral; a value of a newly accepted kind is stored as a float or an int, and a value accepted before is stored as given. A float for an integer parameter, a str or a complex still raise TypeError.The tests came first (first commit): both fail on dev with those two errors. The last commit regenerates
_ta_lib.c(Cython 3.3.0). Rebased on dev after #781; against C dev 62021c1d1, built from the .pyx and again from the regenerated .c: 2033 passed, 1 skipped.@mrjbq7 If this is OK with you, then I will integrate this on the dev branch for the next release.