Skip to content

Commit

Permalink
DOC: edit NonDeliverableCashflow (#650)
Browse files Browse the repository at this point in the history
Co-authored-by: JHM Darbyshire (M1) <[email protected]>
  • Loading branch information
attack68 and attack68 authored Jan 25, 2025
1 parent 2ccb97b commit ccfb5f7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/source/d_periods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ of each *Period* type:
rateslib.periods.Cashflow
rateslib.periods.IndexFixedPeriod
rateslib.periods.IndexCashflow
rateslib.periods.NonDeliverableCashflow

**Common methods**

Expand Down
14 changes: 13 additions & 1 deletion python/rateslib/periods/cashflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,19 @@ def npv(
return _maybe_local(disc_cashflow, local, self.settlement_currency, fx, base)

def cashflow(self, fx: FX_) -> DualTypes:
"""Cashflow is expressed in the settlement, i.e. deliverable currency."""
"""
Determine the cashflow amount, expressed in ``settlement_currency``.
Parameters
----------
fx: FXforwards, optional
Required to forecast the FX rate at settlement, if an ``fx_fixing`` is not known.
Returns
-------
float, Dual, Dual2
"""

if isinstance(self.fx_fixing, NoInput):
fx_ = _validate_fx_as_forwards(fx)
fx_fixing: DualTypes = fx_.rate(self.pair, self.settlement)
Expand Down

0 comments on commit ccfb5f7

Please sign in to comment.