voly 0.0.25__tar.gz → 0.0.28__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.25
3
+ Version: 0.0.28
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.25"
7
+ version = "0.0.28"
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.25"
63
+ python_version = "0.0.28"
64
64
  warn_return_any = true
65
65
  warn_unused_configs = true
66
66
  disallow_untyped_defs = true
@@ -22,8 +22,8 @@ from voly.core.fit import fit_model, get_surface
22
22
  from voly.core.rnd import calculate_rnd, calculate_pdf, calculate_cdf, calculate_strike_probability
23
23
  from voly.core.interpolate import interpolate_model
24
24
  from voly.core.charts import (
25
- plot_all_smiles, plot_3d_surface, plot_parameters,
26
- plot_fit_statistics, plot_rnd, plot_pdf, plot_cdf, plot_rnd_all_expiries,
25
+ plot_all_smiles, plot_3d_surface, plot_parameters, plot_fit_performance,
26
+ plot_fit_performance, plot_rnd, plot_pdf, plot_cdf, plot_rnd_all_expiries,
27
27
  plot_rnd_3d, plot_rnd_statistics, plot_interpolated_surface
28
28
  )
29
29
 
@@ -46,47 +46,41 @@ def plot_volatility_smile(moneyness: np.ndarray,
46
46
  y=iv * 100, # Convert to percentage
47
47
  mode='lines',
48
48
  name='Model',
49
- line=dict(color='#00FFC1', width=2)
49
+ line=dict(color='#636EFA', width=2)
50
50
  )
51
51
  )
52
52
 
53
- # Add market data if provided
54
- if market_data is not None and expiry is not None:
55
- # Filter market data for the specific expiry
56
- expiry_data = market_data[market_data['yte'] == expiry]
53
+ # Filter market data for the specific expiry
54
+ expiry_data = market_data[market_data['yte'] == expiry]
57
55
 
58
- if not expiry_data.empty:
59
- # Add bid IV
60
- fig.add_trace(
61
- go.Scatter(
62
- x=expiry_data['log_moneyness'],
63
- y=expiry_data['bid_iv'] * 100, # Convert to percentage
64
- mode='markers',
65
- name='Bid IV',
66
- marker=dict(size=8, symbol='circle', opacity=0.7)
67
- )
56
+ if not expiry_data.empty:
57
+ # Add bid IV
58
+ fig.add_trace(
59
+ go.Scatter(
60
+ x=expiry_data['log_moneyness'],
61
+ y=expiry_data['bid_iv'] * 100, # Convert to percentage
62
+ mode='markers',
63
+ name='Bid IV',
64
+ marker=dict(size=8, symbol='circle', opacity=0.7)
68
65
  )
66
+ )
69
67
 
70
- # Add ask IV
71
- fig.add_trace(
72
- go.Scatter(
73
- x=expiry_data['log_moneyness'],
74
- y=expiry_data['ask_iv'] * 100, # Convert to percentage
75
- mode='markers',
76
- name='Ask IV',
77
- marker=dict(size=8, symbol='circle', opacity=0.7)
78
- )
68
+ # Add ask IV
69
+ fig.add_trace(
70
+ go.Scatter(
71
+ x=expiry_data['log_moneyness'],
72
+ y=expiry_data['ask_iv'] * 100, # Convert to percentage
73
+ mode='markers',
74
+ name='Ask IV',
75
+ marker=dict(size=8, symbol='circle', opacity=0.7)
79
76
  )
77
+ )
80
78
 
81
- # Get maturity name and DTE for title if not provided
82
- if title is None:
83
- maturity_name = expiry_data['maturity_name'].iloc[0]
84
- dte_value = expiry_data['dte'].iloc[0]
85
- title = f'Volatility Smile for {maturity_name} (DTE: {dte_value:.1f}, YTE: {expiry:.4f})'
86
-
87
- # Use default title if not provided
88
- if title is None:
89
- title = 'Volatility Smile'
79
+ # Get maturity name and DTE for title if not provided
80
+ if title is None:
81
+ maturity_name = expiry_data['maturity_name'].iloc[0]
82
+ dte_value = expiry_data['dte'].iloc[0]
83
+ title = f'Vol Smile for {maturity_name} (DTE: {dte_value:.1f})'
90
84
 
91
85
  # Update layout
92
86
  fig.update_layout(
@@ -243,7 +237,7 @@ def plot_parameters(raw_param_matrix: pd.DataFrame,
243
237
 
244
238
 
245
239
  @catch_exception
246
- def plot_fit_statistics(fit_performance: pd.DataFrame) -> go.Figure:
240
+ def plot_fit_performance(fit_performance: pd.DataFrame) -> go.Figure:
247
241
  """
248
242
  Plot the fitting accuracy statistics.
249
243
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.25
3
+ Version: 0.0.28
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