You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
first of all big thanks for supporting the package! I had a problem with the function relax_dgo and also a possible solution:
from pytfa.optim.relaxation import relax_dgo
relaxed_model, slack_model, relax_table = relax_dgo(mytfa)
The follwing Error occours:
~\AppData\Roaming\Python\Python38\site-packages\pytfa\optim\utils.py in symbol_sum(variables)
108 k=0
109 # If we encounter a zero, which is a special type, increase k
--> 110 while isinstance(variables[k], sympy.numbers.Zero) and k<len(variables):
111 k+=1
112 if k == len(variables):
AttributeError: module 'sympy' has no attribute 'numbers'
By changing sympy.numbers.Zero to sympy.core.numbers.Zero in ~\AppData\Roaming\Python\Python38\site-packages\pytfa\optim\utils.py the Error is gone.
This seems like sympy changed something there.
I'm using Python Python 3.8.5 and sympy version 1.6.2
Regards,
Emil
The text was updated successfully, but these errors were encountered:
Thanks a lot for using our package!
Looks like sympy changed the behavior/location of their Zero object (this suggests maybe it was 14 months ago ?). Thanks for the quick fix you provided! Would you mind sending out a PR for this ?
Cheers,
Pierre
Hello,
first of all big thanks for supporting the package! I had a problem with the function relax_dgo and also a possible solution:
from pytfa.optim.relaxation import relax_dgo
relaxed_model, slack_model, relax_table = relax_dgo(mytfa)
The follwing Error occours:
~\AppData\Roaming\Python\Python38\site-packages\pytfa\optim\utils.py in symbol_sum(variables)
108 k=0
109 # If we encounter a zero, which is a special type, increase k
--> 110 while isinstance(variables[k], sympy.numbers.Zero) and k<len(variables):
111 k+=1
112 if k == len(variables):
AttributeError: module 'sympy' has no attribute 'numbers'
By changing sympy.numbers.Zero to sympy.core.numbers.Zero in ~\AppData\Roaming\Python\Python38\site-packages\pytfa\optim\utils.py the Error is gone.
This seems like sympy changed something there.
I'm using Python Python 3.8.5 and sympy version 1.6.2
Regards,
Emil
The text was updated successfully, but these errors were encountered: