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.
- {voly-0.0.40/src/voly.egg-info → voly-0.0.41}/PKG-INFO +1 -1
 - {voly-0.0.40 → voly-0.0.41}/pyproject.toml +2 -2
 - {voly-0.0.40 → voly-0.0.41}/src/voly/core/charts.py +13 -16
 - {voly-0.0.40 → voly-0.0.41/src/voly.egg-info}/PKG-INFO +1 -1
 - {voly-0.0.40 → voly-0.0.41}/LICENSE +0 -0
 - {voly-0.0.40 → voly-0.0.41}/README.md +0 -0
 - {voly-0.0.40 → voly-0.0.41}/setup.cfg +0 -0
 - {voly-0.0.40 → voly-0.0.41}/setup.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/__init__.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/client.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/core/__init__.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/core/data.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/core/fit.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/core/interpolate.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/core/rnd.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/exceptions.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/formulas.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/models.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/utils/__init__.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly/utils/logger.py +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly.egg-info/SOURCES.txt +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly.egg-info/dependency_links.txt +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly.egg-info/requires.txt +0 -0
 - {voly-0.0.40 → voly-0.0.41}/src/voly.egg-info/top_level.txt +0 -0
 - {voly-0.0.40 → voly-0.0.41}/tests/test_client.py +0 -0
 
| 
         @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" 
     | 
|
| 
       4 
4 
     | 
    
         | 
| 
       5 
5 
     | 
    
         
             
            [project]
         
     | 
| 
       6 
6 
     | 
    
         
             
            name = "voly"
         
     | 
| 
       7 
     | 
    
         
            -
            version = "0.0. 
     | 
| 
      
 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. 
     | 
| 
      
 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( 
     | 
| 
       26 
     | 
    
         
            -
                                       
     | 
| 
       27 
     | 
    
         
            -
                                      market_data:  
     | 
| 
      
 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 
     | 
    
         
            -
                                       
     | 
| 
      
 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= 
     | 
| 
       49 
     | 
    
         
            -
                        y= 
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       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= 
     | 
| 
      
 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( 
     | 
| 
      
 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 
     | 
    
         
            -
                         
     | 
| 
       124 
     | 
    
         
            -
                         
     | 
| 
      
 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=' 
     | 
| 
      
 383 
     | 
    
         
            +
                        yaxis_title='Maturities',
         
     | 
| 
       387 
384 
     | 
    
         
             
                        zaxis_title='Implied Volatility (%)'
         
     | 
| 
       388 
385 
     | 
    
         
             
                    ),
         
     | 
| 
       389 
386 
     | 
    
         
             
                    margin=dict(l=65, r=50, b=65, t=90)
         
     | 
| 
         
            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
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     | 
| 
         
            File without changes
         
     |