Hello,
I am trying to estimate the error of a formula, and the code goes to a dead loop.
After some attempts I find the problem lies in the (a**x) like formula, which belongs to 'rpow' type.
A simple example for a dead loop is like:
alpha=N(20,1)
10**alpha
Traceback (most recent call last):
File "", line 1, in
File "/opt/anaconda3/lib/python3.7/site-packages/soerp/init.py", line 426, in rpow
return _make_UF_compatible_object(ADF.rpow(self, val))
File "/opt/anaconda3/lib/python3.7/site-packages/ad/init.py", line 787, in rpow
return to_auto_diff(val)**self
File "/opt/anaconda3/lib/python3.7/site-packages/soerp/init.py", line 426, in rpow
return _make_UF_compatible_object(ADF.rpow(self, val))
File "/opt/anaconda3/lib/python3.7/site-packages/ad/init.py", line 787, in rpow
return to_auto_diff(val)**self
File "/opt/anaconda3/lib/python3.7/site-packages/soerp/init.py", line 426, in rpow
return _make_UF_compatible_object(ADF.rpow(self, val))
File "/opt/anaconda3/lib/python3.7/site-packages/ad/init.py", line 787, in rpow
return to_auto_diff(val)**self
(984 loops skipped...)
File "/opt/anaconda3/lib/python3.7/site-packages/soerp/init.py", line 426, in rpow
return _make_UF_compatible_object(ADF.rpow(self, val))
File "/opt/anaconda3/lib/python3.7/site-packages/ad/init.py", line 787, in rpow
return to_auto_diff(val)**self
File "/opt/anaconda3/lib/python3.7/site-packages/soerp/init.py", line 426, in rpow
return _make_UF_compatible_object(ADF.rpow(self, val))
File "/opt/anaconda3/lib/python3.7/site-packages/ad/init.py", line 787, in rpow
return to_auto_diff(val)**self
File "/opt/anaconda3/lib/python3.7/site-packages/soerp/init.py", line 426, in rpow
return _make_UF_compatible_object(ADF.rpow(self, val))
File "/opt/anaconda3/lib/python3.7/site-packages/ad/init.py", line 787, in rpow
return to_auto_diff(val)**self
File "/opt/anaconda3/lib/python3.7/site-packages/soerp/init.py", line 426, in rpow
return _make_UF_compatible_object(ADF.rpow(self, val))
File "/opt/anaconda3/lib/python3.7/site-packages/ad/init.py", line 787, in rpow
return to_auto_diff(val)**self
File "/opt/anaconda3/lib/python3.7/site-packages/ad/init.py", line 39, in to_auto_diff
if isinstance(x, ADF):
RecursionError: maximum recursion depth exceeded while calling a Python object
In soerp/init.py:
def rpow(self, val):
return _make_UF_compatible_object(ADF.rpow(self, val))
In ad/init.py:
def rpow(self,val):
return to_auto_diff(val)**self
Please solve this problem, thanks!
Sincerely,
Peter
Hello,
I am trying to estimate the error of a formula, and the code goes to a dead loop.
After some attempts I find the problem lies in the (a**x) like formula, which belongs to 'rpow' type.
A simple example for a dead loop is like:
In soerp/init.py:
def rpow(self, val):
return _make_UF_compatible_object(ADF.rpow(self, val))
In ad/init.py:
def rpow(self,val):
return to_auto_diff(val)**self
Please solve this problem, thanks!
Sincerely,
Peter