Skip to content

Commit

Permalink
REF: amend cache_states to decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
attack68 committed Jan 28, 2025
1 parent 65714b5 commit c1d80e0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions python/rateslib/fx_volatility.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from collections import OrderedDict
from datetime import datetime, timedelta
from datetime import datetime as dt
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, TypeAlias
from uuid import uuid4

import numpy as np
Expand Down Expand Up @@ -41,14 +41,14 @@
from rateslib.rs import index_left_f64
from rateslib.splines import PPSplineDual, PPSplineDual2, PPSplineF64, evaluate

if TYPE_CHECKING:
from rateslib.typing import DualTypes

# if TYPE_CHECKING:
# from rateslib.typing import DualTypes
DualTypes: TypeAlias = "float | Dual | Dual2 | Variable" # if not defined causes _WithCache failure

TERMINAL_DATE = dt(2100, 1, 1)


class FXDeltaVolSmile(_WithState, _WithCache): # type: ignore[type-arg]
class FXDeltaVolSmile(_WithState, _WithCache[float, DualTypes]):
r"""
Create an *FX Volatility Smile* at a given expiry indexed by delta percent.
Expand Down Expand Up @@ -95,7 +95,6 @@ class FXDeltaVolSmile(_WithState, _WithCache): # type: ignore[type-arg]
"""

_ini_solve = 0 # All node values are solvable
_cache: OrderedDict[float, DualTypes]

def __init__(
self,
Expand Down

0 comments on commit c1d80e0

Please sign in to comment.