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

TypeError on iterative models #71

Closed
tactycHQ opened this issue Sep 12, 2019 · 2 comments
Closed

TypeError on iterative models #71

tactycHQ opened this issue Sep 12, 2019 · 2 comments

Comments

@tactycHQ
Copy link

tactycHQ commented Sep 12, 2019

I have tested this issue on multiple complex models that use iterations and keep coming up against this error.

  File "C:\Users\a\.conda\envs\pycel\lib\site-packages\pycel\excelutil.py", line 1317, in done
    return (self.ns.iteration_number >= self.ns.iterations or
TypeError: '>=' not supported between instances of 'int' and 'NoneType

Any advice or suggestions would be helpful on why this error occurs,

@tactycHQ
Copy link
Author

tactycHQ commented Sep 12, 2019

After investigating this further, could this be because the iterations param is set to None in the __call__ function of the _IterativeEvalTracker class? Once I change that param to 100 or some number, this error goes away.

Should the default param be changed from None to 100 (or some number)

@JSv4
Copy link

JSv4 commented Aug 26, 2021

FYI, for anyone else facing the same issue, the solution is here: #58. Some workbooks don't have iterative calculations enabled and, as noted above, this causes an error if you try to run an evaluation unless you override the workbook's default iterative solver settings.

Per the comments to the merge I linked to above:

1) When you instantiate the compiler, set cycles=True:

ExcelCompiler(..., cycles=True)

2) Then you have to add two new parameters to evaluate( ):

ExcelCompiler.evaluate(..., iterations=100, tolerance=0.001)

This worked for me as of 8/26/2021 using Pycel v 1.0b27

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

No branches or pull requests

1 participant