pycheck-neuron 1.0.3__tar.gz → 1.0.4__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.3 → pycheck_neuron-1.0.4}/PKG-INFO +29 -5
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/README.md +318 -294
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck/__init__.py +1 -1
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck/analyzer.py +35 -2
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck/flow.py +6 -2
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck/rules.py +235 -3
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck_neuron.egg-info/PKG-INFO +29 -5
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pyproject.toml +1 -1
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/tests/test_cli.py +29 -1
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/tests/test_rules.py +208 -8
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/LICENSE +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck/__main__.py +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck/audit.py +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck/cli.py +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck/server.py +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck_neuron.egg-info/SOURCES.txt +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck_neuron.egg-info/dependency_links.txt +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck_neuron.egg-info/entry_points.txt +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck_neuron.egg-info/requires.txt +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/pycheck_neuron.egg-info/top_level.txt +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/setup.cfg +0 -0
- {pycheck_neuron-1.0.3 → pycheck_neuron-1.0.4}/tests/test_audit.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pycheck-neuron
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: 33-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>
|
|
@@ -105,7 +105,7 @@ PyCheck catches all three before execution:
|
|
|
105
105
|
| Rule | What It Catches | Severity |
|
|
106
106
|
|------|----------------|----------|
|
|
107
107
|
| `T001` | `.shift(-1)` — accessing future data | **Error** |
|
|
108
|
-
| `T002` | `train_test_split()` on time-series data | **Error** |
|
|
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 |
|
|
111
111
|
| `T005` | `.pct_change(-1)` — future percent returns | **Error** |
|
|
@@ -121,7 +121,7 @@ PyCheck catches all three before execution:
|
|
|
121
121
|
| `T015` | Negative `.shift()` inside `groupby().transform()` | **Error** |
|
|
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
|
-
| `T018` | In-sample target encoding
|
|
124
|
+
| `T018` | In-sample target encoding via `.transform()` or un-split group means | **Error** |
|
|
125
125
|
|
|
126
126
|
### Causal Confusion Rules (7 rules — `C001`–`C007`)
|
|
127
127
|
|
|
@@ -193,6 +193,30 @@ pycheck --list # List all 33 rules
|
|
|
193
193
|
pycheck --help
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
+
### Inline Rule Suppression
|
|
197
|
+
|
|
198
|
+
PyCheck supports standard inline suppression comments with audit reason annotations:
|
|
199
|
+
|
|
200
|
+
```python
|
|
201
|
+
# Specific rule suppression
|
|
202
|
+
df['target'] = df['close'].shift(-1) # pycheck: ignore[T001]
|
|
203
|
+
|
|
204
|
+
# Multi-rule suppression with audit justification
|
|
205
|
+
signal = df[['close', 'target']].corr() # pycheck: ignore[C001, C002] reason: exploratory EDA baseline
|
|
206
|
+
|
|
207
|
+
# Blanket ignore or flake8-style noqa
|
|
208
|
+
cv = KFold(n_splits=5, shuffle=True) # pycheck: ignore
|
|
209
|
+
X_tr = scaler.fit_transform(X) # noqa: T010
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Both same-line trailing comments and line-above comments are supported.
|
|
213
|
+
|
|
214
|
+
### Sink-Gated Precision Engine
|
|
215
|
+
|
|
216
|
+
To prevent false alarms during research and exploratory data analysis (EDA), PyCheck uses **AST sink-gating**:
|
|
217
|
+
- Exploratory display calls like `df[['feature', 'target']].head()`, `.plot()`, `.describe()`, and `print(...)` are recognized as safe inspection and will **never** trigger feature leakage (`C002`).
|
|
218
|
+
- The rule strictly guards actual modeling sinks (`X = ...`, `model.fit(...)`, `cross_validate(...)`).
|
|
219
|
+
|
|
196
220
|
### JSON Output (CI/CD Integration)
|
|
197
221
|
|
|
198
222
|
```bash
|
|
@@ -285,9 +309,9 @@ The `pycheck-vscode` extension gives you **real-time red/yellow squiggles** as y
|
|
|
285
309
|
|
|
286
310
|
---
|
|
287
311
|
|
|
288
|
-
##
|
|
312
|
+
## PyCheck Cloud & Enterprise SaaS
|
|
289
313
|
|
|
290
|
-
For
|
|
314
|
+
For institutional hedge funds, algorithmic trading desks, and enterprise ML engineering teams, **PyCheck Cloud** provides continuous compliance and automated gatekeeping:
|
|
291
315
|
|
|
292
316
|
* **Automated PR / MR Gatekeeping**: GitHub App & GitLab integration that automatically blocks pull requests containing temporal leaks, lookahead joins, or cross-fold contamination before they reach production.
|
|
293
317
|
* **Proof-of-Causality Audit Certificates**: Cryptographically verifiable backtest audit reports (PDF & JSON) certifying that quantitative strategies and feature pipelines are provably free of temporal lookahead bias for LP allocators and risk committees.
|