Skip to content

Commit

Permalink
Merge pull request #2 from dbieber/patch-1
Browse files Browse the repository at this point in the history
Fixes links to source in readme.
  • Loading branch information
hjwp committed Apr 13, 2017
2 parents c394b70 + a32f7e8 commit c771e9a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -34,11 +34,11 @@ Some minimal context

In between those two functions, the user can add their own arbitrary code.

One global object is accessible, the `worksheet` ([source](https://github.com/pythonanywhere/dirigible-source/blob/master/python/dirigible/sheet/worksheet.py))
One global object is accessible, the `worksheet` ([source](https://github.com/pythonanywhere/dirigible-spreadsheet/blob/master/dirigible/sheet/worksheet.py))

A worksheet is compose of cells (it is in fact a dictionary, whose keys are the location, expressed as a tuple of column,row, and whose values are cell objects)

A cell ([source](https://github.com/pythonanywhere/dirigible-source/blob/master/python/dirigible/sheet/cell.py)) has two key attributes:
A cell ([source](https://github.com/pythonanywhere/dirigible-spreadsheet/blob/master/dirigible/sheet/cell.py)) has two key attributes:

- its `formula`, which may just be a constant like "hello" or "12,3", or a formula, like =A1+B1
- its `value`, which is the result of evaluating the formula.
Expand All @@ -47,15 +47,15 @@ If the formula is a constant, its value is that constant.

If it's a real formula, then it will be evaluated as part of `evaluate_formulae()`. This involves:

1. Parsing the formula ([source](https://github.com/pythonanywhere/dirigible-source/blob/master/python/dirigible/sheet/formula_interpreter.py))
1. Parsing the formula ([source](https://github.com/pythonanywhere/dirigible-spreadsheet/blob/master/dirigible/sheet/formula_interpreter.py))
- cell formulae can include any valid python, as well as
- special spreadsheet syntax, including cell references like A1 or B2, and special spreadsheet formulae like the SUM function
- any special spreadsheet syntax is parsed and converted to Python
- and finding out the `dependencies`. If the formula for cell A1 includes a reference to B1, then B1 is a dependency of A1

2. Placing it into the whole spreadsheet's dependency graph ([source](https://github.com/pythonanywhere/dirigible-source/blob/master/python/dirigible/sheet/dependency_graph.py))
2. Placing it into the whole spreadsheet's dependency graph ([source](https://github.com/pythonanywhere/dirigible-spreadsheet/blob/master/dirigible/sheet/dependency_graph.py))

3. Evaluating all the branches of that graph, starting from its leaves, by evaluating the cell's formula to get its value. That can then be fed into cells that depend on it, and so on. (See [calculate.py](https://github.com/pythonanywhere/dirigible-source/blob/master/python/dirigible/sheet/calculate.py))
3. Evaluating all the branches of that graph, starting from its leaves, by evaluating the cell's formula to get its value. That can then be fed into cells that depend on it, and so on. (See [calculate.py](https://github.com/pythonanywhere/dirigible-spreadsheet/blob/master/dirigible/sheet/calculate.py))

Cell formulae can also use any user-defined functions from the usercode.

Expand Down

0 comments on commit c771e9a

Please sign in to comment.