Skip to content

Commit

Permalink
REF: divisions to multiplications
Browse files Browse the repository at this point in the history
  • Loading branch information
attack68 committed Jan 1, 2025
1 parent afb2700 commit 436143b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions python/rateslib/periods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ def _ibor_fixings_table(
if self.stub:
# then must perform an interpolated calculation
return self._ibor_stub_fixings_table(curve, disc_curve, right, risk)
else: # not self.stub:
else: # not self.stub:
# then extract the one relevant curve from dict
curve_: Curve = _get_ibor_curve_from_dict(self.freq_months, curve)
else:
Expand Down Expand Up @@ -1990,7 +1990,9 @@ def _rfr_fixings_array(
if self.fixing_method in ["rfr_lockout", "rfr_lockout_avg"]:
rates_dual.iloc[-self.method_param :] = rates_dual.iloc[-self.method_param - 1]
if "avg" in self.fixing_method:
rate: Dual = self._rate_rfr_avg_with_spread(rates_dual.to_numpy(), d["dcf_vals"].to_numpy()) # type: ignore[assignment]
rate: Dual = self._rate_rfr_avg_with_spread(
rates_dual.to_numpy(), d["dcf_vals"].to_numpy()
) # type: ignore[assignment]
else:
rate = self._rate_rfr_isda_compounded_with_spread( # type: ignore[assignment]
rates_dual.to_numpy(), d["dcf_vals"].to_numpy()
Expand Down Expand Up @@ -2101,7 +2103,7 @@ def _get_method_dcf_endpoints(
return start_obs, end_obs, start_dcf, end_dcf

def _get_method_dcf_markers(
self, calendar: CalTypes, convention: str, exposure: bool =False
self, calendar: CalTypes, convention: str, exposure: bool = False
) -> tuple[
Series[datetime],
Series[datetime],
Expand Down Expand Up @@ -2176,9 +2178,7 @@ def _get_method_dcf_markers(
return obs_dates, dcf_dates, dcf_vals, obs_vals # type: ignore[return-value]

def _get_analytic_delta_quadratic_coeffs(
self,
fore_curve: Curve,
disc_curve: Curve
self, fore_curve: Curve, disc_curve: Curve
) -> tuple[DualTypes, DualTypes]:
"""
For use in the Leg._spread calculation get the 'a' and 'b' coefficients
Expand Down Expand Up @@ -2424,9 +2424,13 @@ def cashflows(

return {
**super().cashflows(curve, disc_curve, fx, base),
defaults.headers["rate"]: None if isinstance(self.fixed_rate, NoInput) else _dual_float(self.fixed_rate),
defaults.headers["rate"]: None
if isinstance(self.fixed_rate, NoInput)
else _dual_float(self.fixed_rate),
defaults.headers["survival"]: survival,
defaults.headers["cashflow"]: None if self.cashflow is None else _dual_float(self.cashflow),
defaults.headers["cashflow"]: None
if self.cashflow is None
else _dual_float(self.cashflow),
defaults.headers["npv"]: npv,
defaults.headers["fx"]: _dual_float(fx),
defaults.headers["npv_fx"]: npv_fx,
Expand Down

0 comments on commit 436143b

Please sign in to comment.