Skip to content

Commit

Permalink
added code for quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
nhaga committed Jun 25, 2020
1 parent 749d9d7 commit 39bbe51
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions docs/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
Basics
******



Settings
########

Expand Down Expand Up @@ -134,27 +132,52 @@ SimpleQuote

.. function:: ql.SimpleQuote(value)

.. code-block:: python
s = ql.SimpleQuote(0.01)
**Functions**

- value
- setValue
- isValid

.. code-block:: python
s.value()
s.setValue(0.05)
s.isValid()
DerivedQuote
************

.. function:: ql.DerivedQuote(quoteHandle, function)

.. code-block:: python
d1 = ql.SimpleQuote(0.06)
d2 = ql.DerivedQuote(ql.QuoteHandle(d1),lambda x: 10*x)
CompositeQuote
**************

.. function:: ql.CompositeQuote(quoteHandle, quoteHandle, function)

.. code-block:: python
c1 = ql.SimpleQuote(0.02)
c2 = ql.SimpleQuote(0.03)
def f(x,y):
return x+y
DerivedQuote
************

.. function:: ql.DerivedQuote(quoteHandle, function)

c3 = ql.CompositeQuote(ql.QuoteHandle(c1),ql.QuoteHandle(c2), f)
c3.value()
c4 = ql.CompositeQuote(ql.QuoteHandle(c1),ql.QuoteHandle(c2), lambda x,y:x+y)
c4.value()
----

Expand Down

0 comments on commit 39bbe51

Please sign in to comment.