Sensoria: High-fidelity coverage impact analysis for Python.
Project description
Captain's Log: ML-powered Sensor Telemetry Analysis module for pytest that identifies high-impact, low-complexity areas to test first.
Scanning the planetary surface (codebase) to determine sensor coverage (test coverage) and identify critical impact zones for the fleet.
Features
- Coverage Impact Analysis: Builds call graphs to identify high-impact functions
- ML Complexity Estimation: Predicts test complexity with confidence intervals
- Prioritization: Suggests what to test first based on impact and complexity
- Refitted Out of the Box: Includes pre-trained model, no console calibration required
- Warp Speed Performance: Optimized for speed (analyzes 1700+ functions in ~1.5 seconds)
- Real-time Telemetry: Visual progress bars and step-by-step timing
Docking Procedures
pip install pytest-coverage-impact
Flight Manual
# Run sensor telemetry analysis (--cov-report=json automatically added)
pytest --cov=your_project --coverage-impact
# Show top 10 functions by priority
pytest --cov=your_project --coverage-impact --coverage-impact-top=10
# Generate Telemetry Data (JSON report)
pytest --cov=your_project --coverage-impact --coverage-impact-json=report.json
Example Telemetry Output
Top Functions by Priority (Impact / Complexity)
┏━━━━━━━━━━┳━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━┓
┃ Priority ┃ Score ┃ Impact ┃ Complexity ┃ Function ┃
┡━━━━━━━━━━╇━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━┩
│ 1 │ 2.45 │ 12.5 │ 0.65 [±0.15] │ module.py │
How It Works
- Call Graph Analysis: Parses AST to build function call relationships
- Impact Calculation:
impact = call_frequency × (1 - coverage_pct) - Complexity Estimation: Uses Random Forest ML model (0-1 scale)
- Prioritization:
priority = (impact × confidence) / (complexity × effort) - Reporting: Generates formatted sensor reports showing what to test first
Model Training (Optional)
Module includes pre-trained model - no training required. To recalibrate:
# Combined command - collects telemetry and recalibrates model
pytest --coverage-impact-train
See docs/TRAINING_COMMANDS.md for details.
Requirements
- Python 3.8+
- pytest 7.0+
- coverage 6.0+
- scikit-learn 1.0+
- numpy 1.20+
- rich 13.0+ (terminal formatting)
Mission Log
- CHANGELOG.md - Mission history and sector updates
Documentation
- docs/USAGE.md - Complete Flight Manual with examples
- docs/CONFIGURATION.md - Console Calibration settings and model paths
- docs/TRAINING_COMMANDS.md - Recalibrate custom ML models
- docs/FORMULA_EXPLANATION.md - How telemetry scores are calculated
- docs/CONFIDENCE_AND_PRIORITY.md - How confidence affects prioritization
- docs/RELEASE_PROCESS.md - Launch procedures and publishing to sector PyPI
- docs/PERFORMANCE.md - Warp speed optimizations explained
Development
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest tests/
# Format code
black pytest_coverage_impact tests/
ruff check pytest_coverage_impact tests/
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_coverage_impact-1.5.0.tar.gz.
File metadata
- Download URL: pytest_coverage_impact-1.5.0.tar.gz
- Upload date:
- Size: 249.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
944304c19bc474a7374cf06f0e0df153cba4b7780052038cf30767beb8797638
|
|
| MD5 |
157e786c8d78d62dd0865e0f11bace43
|
|
| BLAKE2b-256 |
afd0d6fb054ade1ae6c8bc55f67d22122a52156cb8b00a406e63cf8fa30902be
|
Provenance
The following attestation bundles were made for pytest_coverage_impact-1.5.0.tar.gz:
Publisher:
publish.yml on noah-goodrich/pytest-coverage-impact
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_coverage_impact-1.5.0.tar.gz -
Subject digest:
944304c19bc474a7374cf06f0e0df153cba4b7780052038cf30767beb8797638 - Sigstore transparency entry: 829588012
- Sigstore integration time:
-
Permalink:
noah-goodrich/pytest-coverage-impact@1b9e02212fa20ba30faa960c4324bcfdb6edf739 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/noah-goodrich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b9e02212fa20ba30faa960c4324bcfdb6edf739 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pytest_coverage_impact-1.5.0-py3-none-any.whl.
File metadata
- Download URL: pytest_coverage_impact-1.5.0-py3-none-any.whl
- Upload date:
- Size: 251.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de2b541bc531acae1f6faf27e831817ee8c794689f083b5c4e0c73f8808363b3
|
|
| MD5 |
44c7ab0f512c7275a376df2fe3339971
|
|
| BLAKE2b-256 |
b4ebc92acea8c603e6f615ed708698d4f7f1e11cde5b987b560608e758b78bb1
|
Provenance
The following attestation bundles were made for pytest_coverage_impact-1.5.0-py3-none-any.whl:
Publisher:
publish.yml on noah-goodrich/pytest-coverage-impact
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_coverage_impact-1.5.0-py3-none-any.whl -
Subject digest:
de2b541bc531acae1f6faf27e831817ee8c794689f083b5c4e0c73f8808363b3 - Sigstore transparency entry: 829588019
- Sigstore integration time:
-
Permalink:
noah-goodrich/pytest-coverage-impact@1b9e02212fa20ba30faa960c4324bcfdb6edf739 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/noah-goodrich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1b9e02212fa20ba30faa960c4324bcfdb6edf739 -
Trigger Event:
push
-
Statement type: