Skip to content

PSAR fires InvalidOptionError when it should raise InvalidInputError #38

@smauermann

Description

@smauermann

Consider following snippet, where I pass arrays of length 1 to ti.psar():

>>> import tulipy as ti
>>> import numpy as np
>>> ti.psar(np.array([3]), np.array([1]),0.2,2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "xxx/lib/python3.7/site-packages/tulipy/__init__.py", line 919, in psar
    return lib.psar([high, low], [acceleration_factor_step, acceleration_factor_maximum])
  File "tulipy/lib/__init__.pyx", line 105, in tulipy.lib._Indicator.__call__
tulipy.lib.InvalidOptionError

To me the error type is confusing, since clearly the inputs do not conform here. Wouldn't it make sense to raise InvalidInputError here?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions