voly 0.0.40__tar.gz → 0.0.41__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.40
3
+ Version: 0.0.41
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "voly"
7
- version = "0.0.40"
7
+ version = "0.0.41"
8
8
  description = "Options & volatility research package"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -60,7 +60,7 @@ line_length = 100
60
60
  multi_line_output = 3
61
61
 
62
62
  [tool.mypy]
63
- python_version = "0.0.40"
63
+ python_version = "0.0.41"
64
64
  warn_return_any = true
65
65
  warn_unused_configs = true
66
66
  disallow_untyped_defs = true
@@ -22,11 +22,11 @@ pio.renderers.default = "browser"
22
22
 
23
23
 
24
24
  @catch_exception
25
- def plot_volatility_smile(moneyness: np.ndarray,
26
- iv: np.ndarray,
27
- market_data: Optional[pd.DataFrame] = None,
25
+ def plot_volatility_smile(moneyness_array: np.ndarray,
26
+ iv_values: np.ndarray,
27
+ market_data: pd.DataFrame = None,
28
28
  expiry: Optional[float] = None,
29
- title: Optional[str] = None) -> go.Figure:
29
+ ) -> go.Figure:
30
30
  """
31
31
  Plot volatility smile for a single expiry.
32
32
 
@@ -45,8 +45,8 @@ def plot_volatility_smile(moneyness: np.ndarray,
45
45
  # Add model curve
46
46
  fig.add_trace(
47
47
  go.Scatter(
48
- x=moneyness,
49
- y=iv * 100, # Convert to percentage
48
+ x=moneyness_array,
49
+ y=iv_values * 100, # Convert to percentage
50
50
  mode='lines',
51
51
  name='Model',
52
52
  line=dict(color='#0080FF', width=2)
@@ -79,15 +79,12 @@ def plot_volatility_smile(moneyness: np.ndarray,
79
79
  )
80
80
  )
81
81
 
82
- # Get maturity name and DTE for title if not provided
83
- if title is None:
84
- maturity_name = expiry_data['maturity_name'].iloc[0]
85
- dte_value = expiry_data['dte'].iloc[0]
86
- title = f'Vol Smile for {maturity_name} (DTE: {dte_value:.1f})'
82
+ maturity_name = expiry_data['maturity_name'].iloc[0]
83
+ dte_value = expiry_data['dte'].iloc[0]
87
84
 
88
85
  # Update layout
89
86
  fig.update_layout(
90
- title=title,
87
+ title=f'Vol Smile for {maturity_name} (DTE: {dte_value:.1f})',
91
88
  xaxis_title='Log Moneyness',
92
89
  yaxis_title='Implied Volatility (%)',
93
90
  template='plotly_dark',
@@ -98,7 +95,7 @@ def plot_volatility_smile(moneyness: np.ndarray,
98
95
 
99
96
 
100
97
  @catch_exception
101
- def plot_all_smiles(moneyness: np.ndarray,
98
+ def plot_all_smiles(moneyness_array: np.ndarray,
102
99
  iv_surface: Dict[float, np.ndarray],
103
100
  market_data: Optional[pd.DataFrame] = None) -> List[go.Figure]:
104
101
  """
@@ -120,8 +117,8 @@ def plot_all_smiles(moneyness: np.ndarray,
120
117
  # Create a figure for each expiry
121
118
  for expiry in sorted_expiries:
122
119
  fig = plot_volatility_smile(
123
- moneyness=moneyness,
124
- iv=iv_surface[expiry],
120
+ moneyness_array=moneyness_array,
121
+ iv_values=iv_surface[expiry],
125
122
  market_data=market_data,
126
123
  expiry=expiry
127
124
  )
@@ -383,7 +380,7 @@ def plot_3d_surface(moneyness_array: np.ndarray,
383
380
  template='plotly_dark',
384
381
  scene=dict(
385
382
  xaxis_title='Log Moneyness',
386
- yaxis_title='Time to Expiry (years)',
383
+ yaxis_title='Maturities',
387
384
  zaxis_title='Implied Volatility (%)'
388
385
  ),
389
386
  margin=dict(l=65, r=50, b=65, t=90)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.40
3
+ Version: 0.0.41
4
4
  Summary: Options & volatility research package
5
5
  Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
6
  License: MIT
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes