Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError for CUMIPMT function. #74

Closed
austinulfers opened this issue Apr 2, 2021 · 1 comment
Closed

NotImplementedError for CUMIPMT function. #74

austinulfers opened this issue Apr 2, 2021 · 1 comment
Assignees

Comments

@austinulfers
Copy link

austinulfers commented Apr 2, 2021

Describe the bug
It seems that the CUMIPMT function doesn't seem to be supported.

To Reproduce
func = formulas.Parser().ast('=CUMIPMT(A1/12,360,A2,1,12,)')[1].compile()
func(0.04, 181800)

Expected behavior
It should return the value 606.

Screenshots

Traceback (most recent call last):
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\sol.py", line 631, in _evaluate_node
    value = self._evaluate_function(args, node_id, node_attr, attr,
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\sol.py", line 603, in _evaluate_function
    res = async_process(
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\asy\__init__.py", line 178, in async_process
    res = (exe and exe.process_funcs or _process_funcs)(
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\asy\__init__.py", line 136, in _process_funcs
    r['res'] = e.process(sid, fn, *args, **kw) if e else fn(*args, **kw)
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\formulas\functions\__init__.py", line 101, in not_implemented
    raise NotImplementedError
NotImplementedError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:/Users/austi/OneDrive/git-projects/arrived-homes/DataCalculations/Proforma/test.py", line 7, in <module>
    print(func(0.04, 181800))
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\dsp.py", line 1359, in __call__
    if not s._set_node_output(
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\sol.py", line 592, in _set_node_output
    return self._set_function_node_output(node_id, node_attr, no_call,
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\sol.py", line 814, in _set_function_node_output
    res = async_thread(self, args, node_attr, node_id, **kw)
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\asy\__init__.py", line 252, in async_thread
    return sol._evaluate_node(args, node_attr, node_id, *a, **kw)
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\sol.py", line 649, in _evaluate_node
    self._warning(msg, node_id, ex)
  File "C:\Users\austi\OneDrive\git-projects\arrived-homes\DataCalculations\Proforma\env\lib\site-packages\schedula\utils\sol.py", line 1266, in _warning
    raise DispatcherError(
schedula.utils.exc.DispatcherError: ("Failed DISPATCHING '%s' due to:\n  %r", 'CUMIPMT', NotImplementedError())

Desktop (please complete the following information):

  • OS: Windows 10
  • Python: 3.8.6
  • Formulas: 1.1.0
@vinci1it2000 vinci1it2000 self-assigned this Dec 17, 2021
vinci1it2000 added a commit that referenced this issue Dec 21, 2021
…TE`, `CUMIPMT`, and `NPER` functions.
@vinci1it2000 vinci1it2000 added this to the Alicudi Release milestone Dec 22, 2021
@vinci1it2000
Copy link
Owner

The formula is now implemented, but the written formula is incorrect, and I cannot determine the return value you suggested. Using excel the formula =CUMIPMT(0.04/12,360,181800,1,12, 1) returns -6585.8.

>>> import formulas
>>> func = formulas.Parser().ast('=CUMIPMT(A1/12,360,A2,1,12,1)')[1].compile()
>>> func(0.04, 181800)
-6585.775266002218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants