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

False circular references #8

Closed
bleucitron opened this issue Apr 27, 2016 · 3 comments
Closed

False circular references #8

bleucitron opened this issue Apr 27, 2016 · 3 comments

Comments

@bleucitron
Copy link
Contributor

bleucitron commented Apr 27, 2016

Formulas like:
=(totalDecom-SUM(INDEX(FA_RecCostsDecom;1;1):INDEX(FA_RecCostsDecom;1;CA_Periods-1)))*Deprec_UOPRates when calculated on a cell referenced as FA_RecCostsDecom trigger infinite loop.

This is because currently our koala algorithm reevaluates a range each time it sees it in a formula.
A good way to handle this would be to store Ranges (in a koala sense) in a Spreadsheet.range_dict object so that when koala encounters a Range it already knows, it can directly use the values without reevaluating the Range (then avoiding the infinite loop).

2 problems though:

  • this means the way to initialize Ranges must be adjusted so that a Range is created in the dict on the first element inserted (otherwise the previous formula wouldn't work either)
  • this might be a lot of effort for a few cases, since this might not happen that many times
@SergeBredin
Copy link
Contributor

Why Koala algorithm reevaluates each time ??

Le 27 avr. 2016 à 14:48, iOiurson notifications@github.com a écrit :

Formulas like:
=(totalDecom-SUM(INDEX(FA_RecCostsDecom;1;1):INDEX(FA_RecCostsDecom;1;CA_Periods-1)))*Deprec_UOPRates when calculated on a cell referenced as FA_RecCostsDecom triggers infinite loop.

This is because currently our koala algorithm reevaluates a range each time it sees it in a formula.
A good way to handle this would be to store Ranges (in a koala sense) in a Spreadsheet.range_dict object so that when koala encounters a Range it already knows, it can directly use the values without reevaluating the Range (then avoiding the infinite loop).

2 problems though:

this means the way to initialize Ranges must be adjusted so that a Range is created in the dict on the first element inserted (otherwise the previous formula wouldn't work either)
this might be a lot of effort for a few cases, since this might not happen that many times

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub #8

@bleucitron
Copy link
Contributor Author

Imagine the case:
In cell A1 you write =A1, koala would compile this into eval_cell('A1'), leading to an infinite loop.
Excel prevents this behaviour by displaying a warning, explaing how to treat Circular references.

But in our case, this is not a real circular reference, since we call the previous cell in the current range. Still, koala doesn't how to compile this, and will end up looping infinitely.

@SergeBredin
Copy link
Contributor

Sorry, I thought you were speaking about reevaluating each range for each call

Le 27 avr. 2016 à 14:56, iOiurson notifications@github.com a écrit :

Imagine the case:
In cell A1 you write =A1, koala would compile this into eval_cell('A1'), leading to an infinite loop.
Excel prevents this behaviour by displaying a warning, explaing how to treat Circular references.

But in our case, this is not a real circular reference, since we call the previous cell in the current range. Still, koala doesn't how to compile this, and will end up looping infinitely.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub #8 (comment)

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

2 participants