Skip to content

Commit

Permalink
index: Clarify description
Browse files Browse the repository at this point in the history
  • Loading branch information
bgamari committed Jun 26, 2015
1 parent 4ce259f commit 4310071
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,10 @@ How does it work?
Expressions in ``squmfit`` are represented by the :class:`Expr`
class. An ``Expr`` captures an abstract syntax tree that describes
*how* a result can be computed. The elementary expressions could
represent a fitted parameter (e.g. ``amp``) in the example above, or
represent a fitted parameter (e.g. ``amp`` in the example above), or
an expression depending upon a fitted parameter. The ``Expr`` class
implements basic arithmetic operations (e.g. ``__add__``) and numpy's
ufuncs (e.g. ``sqrt``), allowing it to be treated as a standard
scalar.
ufuncs (e.g. ``sqrt``), allowing it to be treated as a scalar or an array.

Of course, some functions require more structure beyond the operations
supported by ``Expr`` evaluate their result. In this case, you can
Expand All @@ -135,6 +134,11 @@ decorator,
>>> def sum_odds(vec):
>>> return vec[1::2].sum()

In this case, we could invoke ``sum_odds`` with an :class:`Expr`,
which ``squmfit`` would automatically evaluate. It would then evaluate
``sum_odds`` with the value of the expression, and pack the result back into an
:class:`Expr`.

.. autofunction:: squmfit.model
:noindex:

Expand Down

0 comments on commit 4310071

Please sign in to comment.