aip-engine 0.2.1__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.
- aip_engine-0.2.1/PKG-INFO +94 -0
- aip_engine-0.2.1/README.md +62 -0
- aip_engine-0.2.1/aip/__init__.py +56 -0
- aip_engine-0.2.1/aip/bio.py +1318 -0
- aip_engine-0.2.1/aip/detector.py +165 -0
- aip_engine-0.2.1/aip/graph.py +124 -0
- aip_engine-0.2.1/aip/llm.py +244 -0
- aip_engine-0.2.1/aip/matrix.py +140 -0
- aip_engine-0.2.1/aip/trading.py +2313 -0
- aip_engine-0.2.1/aip_engine.egg-info/PKG-INFO +94 -0
- aip_engine-0.2.1/aip_engine.egg-info/SOURCES.txt +15 -0
- aip_engine-0.2.1/aip_engine.egg-info/dependency_links.txt +1 -0
- aip_engine-0.2.1/aip_engine.egg-info/requires.txt +11 -0
- aip_engine-0.2.1/aip_engine.egg-info/top_level.txt +1 -0
- aip_engine-0.2.1/pyproject.toml +43 -0
- aip_engine-0.2.1/setup.cfg +4 -0
- aip_engine-0.2.1/tests/test_core.py +236 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: aip-engine
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Algebraic Independence Processor - auto-detects structure for optimal computation
|
|
5
|
+
Author: Carmen Esteban
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/iafiscal1212/-aip-project-2026
|
|
8
|
+
Project-URL: Repository, https://github.com/iafiscal1212/-aip-project-2026
|
|
9
|
+
Keywords: linear-algebra,sparse-matrix,graph-analysis,structure-detection,moe,optimization
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: numpy>=1.20
|
|
25
|
+
Requires-Dist: scipy>=1.7
|
|
26
|
+
Provides-Extra: trading
|
|
27
|
+
Requires-Dist: requests>=2.28; extra == "trading"
|
|
28
|
+
Provides-Extra: bio
|
|
29
|
+
Requires-Dist: requests>=2.28; extra == "bio"
|
|
30
|
+
Provides-Extra: all
|
|
31
|
+
Requires-Dist: requests>=2.28; extra == "all"
|
|
32
|
+
|
|
33
|
+
# AIP Engine
|
|
34
|
+
|
|
35
|
+
**Algebraic Independence Processor** - Auto-detects structure in your data and picks the optimal computation path.
|
|
36
|
+
|
|
37
|
+
## Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install aip-engine
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Quick start
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import aip
|
|
47
|
+
import numpy as np
|
|
48
|
+
|
|
49
|
+
# Matrix multiply: auto-detects sparse vs dense
|
|
50
|
+
A = np.eye(1000) * 3.0
|
|
51
|
+
B = np.eye(1000) * 2.0
|
|
52
|
+
C = aip.multiply(A, B) # uses scipy.sparse automatically
|
|
53
|
+
|
|
54
|
+
# Solve linear system: auto-routes by shape and density
|
|
55
|
+
x = aip.solve(A, np.ones(1000))
|
|
56
|
+
|
|
57
|
+
# Graph analysis: communities, fraud detection
|
|
58
|
+
edges = [(0, 1), (1, 2), (2, 0), (3, 4)]
|
|
59
|
+
info = aip.analyze(edges)
|
|
60
|
+
|
|
61
|
+
# MoE acceleration: only activate needed experts
|
|
62
|
+
result = aip.moe_forward(x_input, experts, router, n_active=4)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## What it does
|
|
66
|
+
|
|
67
|
+
| Input | AIP detects | Routes to |
|
|
68
|
+
|-------|------------|-----------|
|
|
69
|
+
| Sparse matrix | density < 30% | `scipy.sparse` (CSR) |
|
|
70
|
+
| Dense matrix | density >= 30% | `numpy` / BLAS |
|
|
71
|
+
| Square sparse system | square + sparse | `spsolve` |
|
|
72
|
+
| Rectangular sparse | non-square + sparse | `LSQR` iterative |
|
|
73
|
+
| Rectangular dense | non-square + dense | `lstsq` |
|
|
74
|
+
| Bipartite graph | 2-colorable | bipartite decomposition |
|
|
75
|
+
| Disconnected graph | multiple components | independent solve |
|
|
76
|
+
| MoE model | router scores | top-k expert activation |
|
|
77
|
+
|
|
78
|
+
## Optional modules
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
pip install aip-engine[trading] # financial signal analysis
|
|
82
|
+
pip install aip-engine[bio] # protein structure analysis
|
|
83
|
+
pip install aip-engine[all] # everything
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Requirements
|
|
87
|
+
|
|
88
|
+
- Python 3.8+
|
|
89
|
+
- NumPy >= 1.20
|
|
90
|
+
- SciPy >= 1.7
|
|
91
|
+
|
|
92
|
+
## License
|
|
93
|
+
|
|
94
|
+
MIT - Carmen Esteban, 2025-2026
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# AIP Engine
|
|
2
|
+
|
|
3
|
+
**Algebraic Independence Processor** - Auto-detects structure in your data and picks the optimal computation path.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install aip-engine
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
import aip
|
|
15
|
+
import numpy as np
|
|
16
|
+
|
|
17
|
+
# Matrix multiply: auto-detects sparse vs dense
|
|
18
|
+
A = np.eye(1000) * 3.0
|
|
19
|
+
B = np.eye(1000) * 2.0
|
|
20
|
+
C = aip.multiply(A, B) # uses scipy.sparse automatically
|
|
21
|
+
|
|
22
|
+
# Solve linear system: auto-routes by shape and density
|
|
23
|
+
x = aip.solve(A, np.ones(1000))
|
|
24
|
+
|
|
25
|
+
# Graph analysis: communities, fraud detection
|
|
26
|
+
edges = [(0, 1), (1, 2), (2, 0), (3, 4)]
|
|
27
|
+
info = aip.analyze(edges)
|
|
28
|
+
|
|
29
|
+
# MoE acceleration: only activate needed experts
|
|
30
|
+
result = aip.moe_forward(x_input, experts, router, n_active=4)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## What it does
|
|
34
|
+
|
|
35
|
+
| Input | AIP detects | Routes to |
|
|
36
|
+
|-------|------------|-----------|
|
|
37
|
+
| Sparse matrix | density < 30% | `scipy.sparse` (CSR) |
|
|
38
|
+
| Dense matrix | density >= 30% | `numpy` / BLAS |
|
|
39
|
+
| Square sparse system | square + sparse | `spsolve` |
|
|
40
|
+
| Rectangular sparse | non-square + sparse | `LSQR` iterative |
|
|
41
|
+
| Rectangular dense | non-square + dense | `lstsq` |
|
|
42
|
+
| Bipartite graph | 2-colorable | bipartite decomposition |
|
|
43
|
+
| Disconnected graph | multiple components | independent solve |
|
|
44
|
+
| MoE model | router scores | top-k expert activation |
|
|
45
|
+
|
|
46
|
+
## Optional modules
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install aip-engine[trading] # financial signal analysis
|
|
50
|
+
pip install aip-engine[bio] # protein structure analysis
|
|
51
|
+
pip install aip-engine[all] # everything
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Requirements
|
|
55
|
+
|
|
56
|
+
- Python 3.8+
|
|
57
|
+
- NumPy >= 1.20
|
|
58
|
+
- SciPy >= 1.7
|
|
59
|
+
|
|
60
|
+
## License
|
|
61
|
+
|
|
62
|
+
MIT - Carmen Esteban, 2025-2026
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""
|
|
2
|
+
AIP - Algebraic Independence Processor
|
|
3
|
+
|
|
4
|
+
Auto-detects structure in your data and picks the optimal computation path.
|
|
5
|
+
|
|
6
|
+
Core engine:
|
|
7
|
+
import aip
|
|
8
|
+
import numpy as np
|
|
9
|
+
|
|
10
|
+
# Matrices: auto-detects sparse vs dense
|
|
11
|
+
C = aip.multiply(A, B)
|
|
12
|
+
|
|
13
|
+
# Linear system: auto-detects structure
|
|
14
|
+
x = aip.solve(A, b)
|
|
15
|
+
|
|
16
|
+
# Graphs: auto-detects communities, fraud
|
|
17
|
+
info = aip.analyze(edges)
|
|
18
|
+
|
|
19
|
+
# MoE: only activate needed experts
|
|
20
|
+
result = aip.moe_forward(x, experts, router)
|
|
21
|
+
|
|
22
|
+
Optional modules (install with extras):
|
|
23
|
+
pip install aip-engine[trading]
|
|
24
|
+
pip install aip-engine[bio]
|
|
25
|
+
pip install aip-engine[all]
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
__version__ = "0.2.1"
|
|
29
|
+
|
|
30
|
+
# ── Core engine (always available) ──────────────────────────
|
|
31
|
+
from .detector import detect, detect_matrix, StructureReport
|
|
32
|
+
from .matrix import multiply, multiply_verbose, solve
|
|
33
|
+
from .graph import analyze, detect_fraud
|
|
34
|
+
from .llm import MoEEngine, moe_forward, benchmark_moe
|
|
35
|
+
|
|
36
|
+
# ── Optional: Trading ───────────────────────────────────────
|
|
37
|
+
try:
|
|
38
|
+
from .trading import (denoise, find_patterns, scan_binance,
|
|
39
|
+
scan_multiframe, clean_indicators, score,
|
|
40
|
+
verify, auto_strength, order_book_analysis,
|
|
41
|
+
correlation_analysis, funding_rate,
|
|
42
|
+
score_v2, backtest, alert_scan,
|
|
43
|
+
hindsight_test)
|
|
44
|
+
_trading_available = True
|
|
45
|
+
except Exception:
|
|
46
|
+
_trading_available = False
|
|
47
|
+
|
|
48
|
+
# ── Optional: Biology ───────────────────────────────────────
|
|
49
|
+
try:
|
|
50
|
+
from .bio import (parse_pdb, analyze_protein, compare_mutant,
|
|
51
|
+
download_pdb, analyze_p53, simulate_mutation,
|
|
52
|
+
find_rescue_mutations, simulate_rescue,
|
|
53
|
+
validate_rescue)
|
|
54
|
+
_bio_available = True
|
|
55
|
+
except Exception:
|
|
56
|
+
_bio_available = False
|