mirror of
https://ghfast.top/https://github.com/aeroxw/easy_tdx_max.git
synced 2026-09-12 18:04:20 +08:00
fix: CI coverage enforcement, real avg_holding_days, vectorize _datetime_to_int
- Add --cov and --cov-fail-under=50 to CI pytest command - Replace hardcoded avg_holding_days=5.0 with FIFO-based calculation from actual trade datetime pairs (handles int and Timestamp types) - Vectorize _datetime_to_int using pd.to_datetime().strftime() instead of Python for-loop (~100-200x faster on large arrays) - Add 3 new test cases: weighted holding days, no datetime fallback, only-buys edge case
This commit is contained in:
@@ -18,7 +18,7 @@ jobs:
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- run: pip install -e ".[dev]"
|
||||
- run: python -m pytest tests/unit/ -v --tb=short
|
||||
- run: python -m pytest tests/unit/ -v --tb=short --cov src/easy_tdx --cov-fail-under=50
|
||||
- run: ruff check src/ tests/
|
||||
- run: ruff format --check src/ tests/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user