Add comprehensive integration tests and improve project structure#4
Merged
CameronScarpati merged 5 commits intomainfrom Mar 12, 2026
Merged
Add comprehensive integration tests and improve project structure#4CameronScarpati merged 5 commits intomainfrom
CameronScarpati merged 5 commits intomainfrom
Conversation
28 integration tests verifying all phases work together end-to-end: - IV extraction from synthetic BS prices recovers original IVs - SVI calibration produces high-quality fits (R² > 0.95) from IV chain - Arbitrage diagnostics correctly evaluate fitted surfaces - build_surface pipeline (IV → SVI → diagnostics) produces valid VolSurface - Surface interpolation works with fit_all_slices output - Analytical derivatives are consistent across svi_fitter and arbitrage modules - BS → IV → BS roundtrip validates the numerical engine at scale - Dashboard data flow tests verify all component column requirements are met All 118 tests pass (90 existing unit + 28 new integration).
…aset - GitHub Actions CI: runs tests on Python 3.10-3.12 with synthetic data - README: architecture diagram, mathematical methodology (SVI, Durrleman, Newton-Raphson), quick start guide, project structure, references - data/download.py: full CLI for fetching real SPY data via yfinance with pipeline summary output (IV extraction, SVI fit quality, arbitrage status) - data/spy_options.parquet: committed synthetic cached data so the dashboard works out of the box without network access - .gitignore: allow parquet data to be tracked
- Add __all__ exports to all src/ modules and populate src/__init__.py - Make PARAM_BOUNDS public (was _PARAM_BOUNDS) and fix import in arbitrage.py - Create tests/conftest.py with shared fixtures and synthetic data helpers - Add pytest slow marker for integration tests - Extract dashboard/components/helpers.py to reduce DRY violations - Modernize pyproject.toml with full metadata, ruff config, pytest markers - Improve CI with separate lint job, pip caching, Python matrix - Fix all ruff lint errors (noqa:E402, zip strict=True, int(round()) cleanup) - All 130 tests pass, ruff check clean
- Add MIT LICENSE file - Add License and Ruff badges to README - Update project structure in README to reflect conftest.py, helpers.py - Add Homepage and Issues URLs to pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a complete end-to-end integration test suite covering the full volatility surface pipeline, improves project documentation and structure, and refactors dashboard components for better code reuse.
Key Changes
Testing & Quality Assurance
tests/test_integration.py): 358 lines covering the complete pipeline from synthetic data generation through IV extraction, SVI calibration, arbitrage diagnostics, and surface queriesbuild_surface()pipeline validationtests/conftest.py): Centralized synthetic data generation and market parameters (SPOT, RISK_FREE, DIV_YIELD) used across all test modules.github/workflows/ci.yml): GitHub Actions workflow testing Python 3.10–3.12 with linting and cachingDocumentation
__all__exports to all source modules for clarityCode Organization & Refactoring
dashboard/components/helpers.py): Consolidates repeated computation patterns (forward price, log-moneyness, fitted IV from SVI) to eliminate duplication across componentsdashboard/components/__init__.py): Centralized exports for cleaner imports inapp.py__all__lists tosrc/modules (iv_engine.py,svi_fitter.py,arbitrage.py,data_loader.py,surface.py) andsrc/__init__.pyfor public API clarityresidual_heatmap.pyandterm_structure.pyto use the newcompute_chain_fitted_iv()helper, reducing code duplication by ~30 linesData & Scripts
data/download.py): Added--syntheticflag, improved output formatting, integrated full pipeline execution with surface building and diagnosticsdata/spy_options.parquetto support fast dashboard reloadscripts/generate_synthetic_data.py): Fixed import orderingConfiguration
Minor Fixes
int(round(...))→round(...)).gitignoreto allow parquet caching while excluding CSVsNotable Implementation Details
conftest.pymatches the realistic SPY-like characteristics used ingenerate_synthetic_data.py, ensuring test data consistency@pytest.mark.slowto allow selective execution with-m "not slow"helpers.py, reducing maintenance burdenhttps://claude.ai/code/session_014Cap2tLzWHDwrx9GrfGJE3