Spreadsheet-style dependency tracking

Fuzzyman fuzzyman at gmail.com
Mon Oct 18 07:17:37 EDT 2010


On Oct 17, 12:35 pm, Florian Weimer <f... at deneb.enyo.de> wrote:
> * Chris Torek:
>
> > In article <87y69xbz6h.... at mid.deneb.enyo.de>
> > Florian Weimer  <f... at deneb.enyo.de> wrote:
> >>Are there libraries which implement some form of spreadsheet-style
> >>dependency tracking?  The idea is to enable incremental updates to
> >>some fairly convoluted computation.  I hope that a general dependency
> >>tracking framework would avoid making the computation even more
> >>convoluted and difficult to change.
>
> > Don't know of any libraries myself, but I wrote some code to do
> > topological sort for dependencies, which I can paste here.  It
> > is also worth noting that a lot of spreadsheets cheat: they just
> > repeat a sheet-wide computation until values stop changing (or a
> > cycle count limit runs out).
>
> I think most of the relevant implementations use dependency
> information to speed up incremental recomputation.  For instance,
> gnumeric seems to have code for this.  This is the part I'm most
> interested in.  I already have got an explicit ordering of the
> computations (fortunately, that part is fairly simple).

And note that the repeating sheet-wide computation is a feature not a
"cheat" (the default should still be to report cycles). Allowing
calculations to complete even in the presence of cycles can be very
useful.

Michael Foord
--
http://www.voidspace.org.uk/



More information about the Python-list mailing list