Skip to content

Commit 27ba110

Browse files
committed
lint
1 parent e516fbe commit 27ba110

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

quantflow/options/bs.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ def black_price(
2525
ttm: FloatArrayLike,
2626
s: FloatArrayLike,
2727
) -> np.ndarray:
28-
"""Calculate the Black call/put option prices in forward terms
28+
r"""Calculate the Black call/put option prices in forward terms
2929
from the following params
3030
3131
.. math::
32-
c &= \\frac{C}{F} = N(d1) - e^k N(d2)
32+
c &= \frac{C}{F} = N(d1) - e^k N(d2)
3333
34-
p &= \\frac{C}{F} = -N(-d1) + e^k N(-d2)
34+
p &= \frac{C}{F} = -N(-d1) + e^k N(-d2)
3535
36-
d1 &= \\frac{-k + \\frac{\sigma^2 t}{2}}{\sigma \sqrt{t}}
36+
d1 &= \frac{-k + \frac{\sigma^2 t}{2}}{\sigma \sqrt{t}}
3737
3838
d2 &= d1 - \sigma \sqrt{t}
3939
40-
:param k: a vector of :math:`\log{\\frac{K}{F}}` also known as moneyness
40+
:param k: a vector of :math:`\log{\frac{K}{F}}` also known as moneyness
4141
:param sigma: a corresponding vector of implied volatilities (0.2 for 20%)
4242
:param ttm: time to maturity
4343
:param s: the call/put flag, 1 for calls, -1 for puts
@@ -52,13 +52,13 @@ def black_price(
5252

5353

5454
def black_vega(k: np.ndarray, sigma: np.ndarray, ttm: FloatArrayLike) -> np.ndarray:
55-
"""Calculate the Black option vega from the moneyness,
55+
r"""Calculate the Black option vega from the moneyness,
5656
volatility and time to maturity.
5757
5858
.. math::
5959
60-
\\nu = \\frac{\\partial c}{\\partial \sigma} =
61-
\\frac{\\partial p}{\\partial \sigma} = N'(d1) \sqrt{t}
60+
\nu = \frac{\partial c}{\partial \sigma} =
61+
\frac{\partial p}{\partial \sigma} = N'(d1) \sqrt{t}
6262
6363
:param k: a vector of moneyness, see above
6464
:param sigma: a corresponding vector of implied volatilities (0.2 for 20%)

quantflow/options/calibration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class VolModelCalibration(ABC, Generic[M]):
6868
"""The weight for moneyness"""
6969
options: dict[ModelCalibrationEntryKey, OptionEntry] = field(default_factory=dict)
7070
"""The options to calibrate"""
71-
71+
7272
def __post_init__(self) -> None:
7373
if not self.options:
7474
self.vol_surface.bs()

quantflow/options/inputs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
class VolSecurityType(enum.StrEnum):
1414
"""Type of security for the volatility surface"""
15+
1516
spot = enum.auto()
1617
forward = enum.auto()
1718
option = enum.auto()

quantflow/options/surface.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ def option_prices(
305305
@dataclass
306306
class VolCrossSection(Generic[S]):
307307
"""Represents a cross section of a volatility surface at a specific maturity."""
308+
308309
maturity: datetime
309310
"""Maturity date of the cross section"""
310311
forward: FwdPrice[S]

0 commit comments

Comments
 (0)