pycheck-neuron 1.0.4__tar.gz → 1.0.5__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.
- {pycheck_neuron-1.0.4/pycheck_neuron.egg-info → pycheck_neuron-1.0.5}/PKG-INFO +8 -7
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/README.md +319 -318
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck/__init__.py +10 -10
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck/analyzer.py +244 -236
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck/audit.py +153 -153
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck/flow.py +33 -3
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck/rules.py +1397 -1342
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5/pycheck_neuron.egg-info}/PKG-INFO +8 -7
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pyproject.toml +66 -66
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/tests/test_rules.py +958 -882
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/LICENSE +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck/__main__.py +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck/cli.py +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck/server.py +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck_neuron.egg-info/SOURCES.txt +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck_neuron.egg-info/dependency_links.txt +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck_neuron.egg-info/entry_points.txt +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck_neuron.egg-info/requires.txt +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/pycheck_neuron.egg-info/top_level.txt +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/setup.cfg +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/tests/test_audit.py +0 -0
- {pycheck_neuron-1.0.4 → pycheck_neuron-1.0.5}/tests/test_cli.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pycheck-neuron
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.0.5
|
|
4
|
+
Summary: 34-rule static AST analyzer catching temporal lookahead bias, causal confusion, and uncertainty bugs in Python ML code. Zero dependencies.
|
|
5
5
|
Author: NEURON Team
|
|
6
6
|
Author-email: Fayo Ibrahim <fayo@neuron-lab.org>
|
|
7
7
|
License-Expression: MIT
|
|
@@ -38,7 +38,7 @@ Dynamic: license-file
|
|
|
38
38
|
|
|
39
39
|
# PyCheck — ML Safety Analyzer
|
|
40
40
|
|
|
41
|
-
**
|
|
41
|
+
**34 rules. Zero dependencies. Catches the bugs that cost millions.**
|
|
42
42
|
|
|
43
43
|
PyCheck is a static AST analyzer that detects **temporal lookahead bias**, **causal confusion**, and **unguarded uncertainty** in Python ML and trading scripts — before you run a single line of code.
|
|
44
44
|
|
|
@@ -68,7 +68,7 @@ PyCheck catches all three before execution:
|
|
|
68
68
|
=================================================================
|
|
69
69
|
PyCheck — NEURON ML Safety Analyzer
|
|
70
70
|
Scanning: strategy.py
|
|
71
|
-
Rules:
|
|
71
|
+
Rules: 34 active + Data Flow & Provenance Engine
|
|
72
72
|
=================================================================
|
|
73
73
|
|
|
74
74
|
ERROR[T001]: .shift(-1) accesses data 1 rows INTO THE FUTURE
|
|
@@ -100,11 +100,11 @@ PyCheck catches all three before execution:
|
|
|
100
100
|
|
|
101
101
|
## What It Catches
|
|
102
102
|
|
|
103
|
-
### Temporal Leak Rules (
|
|
103
|
+
### Temporal Leak Rules (19 rules — `T001`–`T019`)
|
|
104
104
|
|
|
105
105
|
| Rule | What It Catches | Severity |
|
|
106
106
|
|------|----------------|----------|
|
|
107
|
-
| `T001` | `.shift(-1)` — accessing future data | **Error** |
|
|
107
|
+
| `T001` | `.shift(-1)` — accessing future data (including bound-method aliases like `sh = df.shift; sh(-1)`) | **Error** |
|
|
108
108
|
| `T002` | `train_test_split()` on time-series data without chronological ordering | **Error** |
|
|
109
109
|
| `T003` | `.rolling()` computed before the train/test split | Warning |
|
|
110
110
|
| `T004` | `.expanding()` computed before split | Warning |
|
|
@@ -122,6 +122,7 @@ PyCheck catches all three before execution:
|
|
|
122
122
|
| `T016` | `pd.merge_asof()` with `direction='nearest'` or `'forward'` | **Error** |
|
|
123
123
|
| `T017` | Target laundering & un-split target encoding (`regime_success_rate`) | **Error** |
|
|
124
124
|
| `T018` | In-sample target encoding via `.transform()` or un-split group means | **Error** |
|
|
125
|
+
| `T019` | `np.roll(arr, -k)` — negative shift rotates future data into present position | **Error** |
|
|
125
126
|
|
|
126
127
|
### Causal Confusion Rules (7 rules — `C001`–`C007`)
|
|
127
128
|
|
|
@@ -189,7 +190,7 @@ pycheck script.py # Errors + warnings (default)
|
|
|
189
190
|
pycheck script.py --info # Include info-level diagnostics
|
|
190
191
|
pycheck script.py --quiet # Errors only
|
|
191
192
|
pycheck script.py --json # JSON output — pipe into CI/CD
|
|
192
|
-
pycheck --list # List all
|
|
193
|
+
pycheck --list # List all 34 rules
|
|
193
194
|
pycheck --help
|
|
194
195
|
```
|
|
195
196
|
|