voly 0.0.15__tar.gz → 0.0.16__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.15
3
+ Version: 0.0.16
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.15"
7
+ version = "0.0.16"
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.15"
63
+ python_version = "0.0.16"
64
64
  warn_return_any = true
65
65
  warn_unused_configs = true
66
66
  disallow_untyped_defs = true
@@ -90,6 +90,11 @@ def fit_svi_parameters(market_data: pd.DataFrame,
90
90
  # Dictionary to store parameters
91
91
  params_dict = {}
92
92
 
93
+ # ANSI color codes for terminal output
94
+ GREEN = '\033[32m'
95
+ RED = '\033[31m'
96
+ RESET = '\033[0m'
97
+
93
98
  # Get unique expiries
94
99
  unique_expiries = sorted(market_data['yte'].unique())
95
100
 
@@ -99,7 +104,7 @@ def fit_svi_parameters(market_data: pd.DataFrame,
99
104
  maturity_name = expiry_data['maturity_name'].iloc[0]
100
105
  dte_value = expiry_data['dte'].iloc[0]
101
106
 
102
- logger.info(f"Optimizing for {maturity_name} (DTE: {dte_value:.1f})...")
107
+ logger.info(f"Optimizing for {maturity_name}...")
103
108
 
104
109
  # Optimize SVI parameters
105
110
  try:
@@ -133,7 +138,7 @@ def fit_svi_parameters(market_data: pd.DataFrame,
133
138
  max_error = np.max(np.abs(iv_market - iv_model))
134
139
  num_points = len(expiry_data)
135
140
 
136
- # Add to fit data - make sure all arrays get the same number of items
141
+ # Add to fit data
137
142
  fit_data['Maturity'].append(maturity_name)
138
143
  fit_data['DTE'].append(dte_value)
139
144
  fit_data['YTE'].append(yte)
@@ -147,9 +152,9 @@ def fit_svi_parameters(market_data: pd.DataFrame,
147
152
  fit_data['Number of Points'].append(num_points)
148
153
 
149
154
  if result.success:
150
- logger.info(f'Optimization for {maturity_name} (DTE: {dte_value:.1f}): SUCCESS')
155
+ logger.info(f'Optimization for {maturity_name}: {GREEN}SUCCESS{RESET}')
151
156
  else:
152
- logger.warning(f'Optimization for {maturity_name} (DTE: {dte_value:.1f}): FAILED')
157
+ logger.warning(f'Optimization for {maturity_name}: {RED}FAILED{RESET}')
153
158
 
154
159
  logger.info('------------------------------------------')
155
160
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voly
3
- Version: 0.0.15
3
+ Version: 0.0.16
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