chen-signatures 0.1.0__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.
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: chen-signatures
3
+ Version: 0.1.0
4
+ Summary: Fast rough path signatures - 1.6× faster than iisignature
5
+ Author-email: Alessandro Combi <alecombi94@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/aleCombi/Chen.jl
8
+ Project-URL: Repository, https://github.com/aleCombi/Chen.jl
9
+ Project-URL: Issues, https://github.com/aleCombi/Chen.jl/issues
10
+ Keywords: signatures,rough-paths,time-series,machine-learning
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: juliacall>=0.9.20
24
+ Requires-Dist: numpy>=1.20.0
25
+
26
+ # chen-signatures
27
+
28
+ Fast rough path signatures for Python, powered by Julia.
29
+
30
+ **1.6× faster** than iisignature with support for **modern Python** (3.9-3.13).
31
+
32
+ [![PyPI](https://img.shields.io/pypi/v/chen-signatures)](https://pypi.org/project/chen-signatures/)
33
+ [![Python](https://img.shields.io/pypi/pyversions/chen-signatures)](https://pypi.org/project/chen-signatures/)
34
+
35
+ ## Why chen-signatures?
36
+
37
+ | Feature | chen-signatures | iisignature |
38
+ |---------|-----------------|-------------|
39
+ | **Speed** | 187 ms | 299 ms |
40
+ | **Python 3.10+** | ✅ Yes | ❌ No (≤3.9 only) |
41
+ | **Python 3.13** | ✅ Yes | ❌ No |
42
+ | **Autodiff** | ✅ Yes (ForwardDiff) | ❌ No |
43
+ | **Maintained** | ✅ Active | ⚠️ Unmaintained |
44
+
45
+ *Benchmark: N=1000 points, d=10 dims, level=5*
46
+
47
+ ## Installation
48
+ ```bash
49
+ pip install chen-signatures
50
+ ```
51
+
52
+ First import will automatically install Julia (via juliacall). Takes ~2 minutes once.
53
+
54
+ ## Quick Start
55
+ ```python
56
+ import chen
57
+ import numpy as np
58
+
59
+ # Your time series data
60
+ path = np.random.randn(1000, 10) # 1000 timepoints, 10 dimensions
61
+
62
+ # Compute signature
63
+ signature = chen.sig(path, m=5)
64
+
65
+ # Compute log-signature
66
+ logsignature = chen.logsig(path, m=5)
67
+ ```
68
+
69
+ ## API
70
+
71
+ ### `sig(path, m)`
72
+
73
+ Compute the truncated signature up to level `m`.
74
+
75
+ **Parameters:**
76
+ - `path` : `(N, d)` numpy array - Path data
77
+ - `m` : int - Truncation level
78
+
79
+ **Returns:**
80
+ - `numpy.ndarray` - Flattened signature coefficients
81
+
82
+ **Example:**
83
+ ```python
84
+ import chen
85
+ import numpy as np
86
+
87
+ path = np.array([[0., 0.], [1., 0.], [1., 1.]])
88
+ sig = chen.sig(path, m=3)
89
+ # Returns array of length d + d² + d³ = 2 + 4 + 8 = 14
90
+ ```
91
+
92
+ ### `logsig(path, m)`
93
+
94
+ Compute the log-signature projected onto the Lyndon basis.
95
+
96
+ **Parameters:**
97
+ - `path` : `(N, d)` numpy array - Path data
98
+ - `m` : int - Truncation level
99
+
100
+ **Returns:**
101
+ - `numpy.ndarray` - Log-signature in Lyndon basis
102
+
103
+ **Example:**
104
+ ```python
105
+ logsig = chen.logsig(path, m=5)
106
+ ```
107
+
108
+ ## Supported Types
109
+
110
+ - `float32` and `float64`
111
+ - Any numpy array-like input
112
+
113
+ ## Performance
114
+
115
+ Production-scale benchmark (N=1000, d=10, m=5):
116
+ ```python
117
+ import chen
118
+ import numpy as np
119
+ import time
120
+
121
+ path = np.random.randn(1000, 10)
122
+
123
+ t0 = time.time()
124
+ sig = chen.sig(path, 5)
125
+ print(f"Time: {(time.time()-t0)*1000:.1f} ms")
126
+ # Output: Time: 187.4 ms
127
+ ```
128
+
129
+ Compare to iisignature: **299.3 ms** (1.6× slower)
130
+
131
+ ## Use Cases
132
+
133
+ - **Financial time series**: Extract signature features from price data
134
+ - **Sensor data**: Process multivariate sensor streams
135
+ - **Neural CDEs**: Differentiable features for neural networks
136
+ - **Anomaly detection**: Signature-based feature engineering
137
+
138
+ ## Limitations
139
+
140
+ - **First import is slow** (~2 min to install Julia environment, one-time)
141
+ - **Not GPU-accelerated** (CPU only, but very fast)
142
+ - **Memory usage**: Uses more RAM than iisignature (but negligible for most applications)
143
+
144
+ ## Requirements
145
+
146
+ - Python ≥3.9
147
+ - NumPy ≥1.20
148
+ - ~500MB disk space (for Julia installation)
149
+
150
+ ## Citation
151
+
152
+ If you use this in research, please cite:
153
+ ```bibtex
154
+ @software{chen_signatures,
155
+ author = {Combi, Alessandro},
156
+ title = {chen-signatures: Fast rough path signatures for Python},
157
+ year = {2025},
158
+ url = {https://github.com/aleCombi/Chen.jl}
159
+ }
160
+ ```
161
+
162
+ ## License
163
+
164
+ MIT License - see [LICENSE](../LICENSE) file.
165
+
166
+ ## Contributing
167
+
168
+ Issues and pull requests welcome at [github.com/aleCombi/Chen.jl](https://github.com/aleCombi/Chen.jl)
@@ -0,0 +1,143 @@
1
+ # chen-signatures
2
+
3
+ Fast rough path signatures for Python, powered by Julia.
4
+
5
+ **1.6× faster** than iisignature with support for **modern Python** (3.9-3.13).
6
+
7
+ [![PyPI](https://img.shields.io/pypi/v/chen-signatures)](https://pypi.org/project/chen-signatures/)
8
+ [![Python](https://img.shields.io/pypi/pyversions/chen-signatures)](https://pypi.org/project/chen-signatures/)
9
+
10
+ ## Why chen-signatures?
11
+
12
+ | Feature | chen-signatures | iisignature |
13
+ |---------|-----------------|-------------|
14
+ | **Speed** | 187 ms | 299 ms |
15
+ | **Python 3.10+** | ✅ Yes | ❌ No (≤3.9 only) |
16
+ | **Python 3.13** | ✅ Yes | ❌ No |
17
+ | **Autodiff** | ✅ Yes (ForwardDiff) | ❌ No |
18
+ | **Maintained** | ✅ Active | ⚠️ Unmaintained |
19
+
20
+ *Benchmark: N=1000 points, d=10 dims, level=5*
21
+
22
+ ## Installation
23
+ ```bash
24
+ pip install chen-signatures
25
+ ```
26
+
27
+ First import will automatically install Julia (via juliacall). Takes ~2 minutes once.
28
+
29
+ ## Quick Start
30
+ ```python
31
+ import chen
32
+ import numpy as np
33
+
34
+ # Your time series data
35
+ path = np.random.randn(1000, 10) # 1000 timepoints, 10 dimensions
36
+
37
+ # Compute signature
38
+ signature = chen.sig(path, m=5)
39
+
40
+ # Compute log-signature
41
+ logsignature = chen.logsig(path, m=5)
42
+ ```
43
+
44
+ ## API
45
+
46
+ ### `sig(path, m)`
47
+
48
+ Compute the truncated signature up to level `m`.
49
+
50
+ **Parameters:**
51
+ - `path` : `(N, d)` numpy array - Path data
52
+ - `m` : int - Truncation level
53
+
54
+ **Returns:**
55
+ - `numpy.ndarray` - Flattened signature coefficients
56
+
57
+ **Example:**
58
+ ```python
59
+ import chen
60
+ import numpy as np
61
+
62
+ path = np.array([[0., 0.], [1., 0.], [1., 1.]])
63
+ sig = chen.sig(path, m=3)
64
+ # Returns array of length d + d² + d³ = 2 + 4 + 8 = 14
65
+ ```
66
+
67
+ ### `logsig(path, m)`
68
+
69
+ Compute the log-signature projected onto the Lyndon basis.
70
+
71
+ **Parameters:**
72
+ - `path` : `(N, d)` numpy array - Path data
73
+ - `m` : int - Truncation level
74
+
75
+ **Returns:**
76
+ - `numpy.ndarray` - Log-signature in Lyndon basis
77
+
78
+ **Example:**
79
+ ```python
80
+ logsig = chen.logsig(path, m=5)
81
+ ```
82
+
83
+ ## Supported Types
84
+
85
+ - `float32` and `float64`
86
+ - Any numpy array-like input
87
+
88
+ ## Performance
89
+
90
+ Production-scale benchmark (N=1000, d=10, m=5):
91
+ ```python
92
+ import chen
93
+ import numpy as np
94
+ import time
95
+
96
+ path = np.random.randn(1000, 10)
97
+
98
+ t0 = time.time()
99
+ sig = chen.sig(path, 5)
100
+ print(f"Time: {(time.time()-t0)*1000:.1f} ms")
101
+ # Output: Time: 187.4 ms
102
+ ```
103
+
104
+ Compare to iisignature: **299.3 ms** (1.6× slower)
105
+
106
+ ## Use Cases
107
+
108
+ - **Financial time series**: Extract signature features from price data
109
+ - **Sensor data**: Process multivariate sensor streams
110
+ - **Neural CDEs**: Differentiable features for neural networks
111
+ - **Anomaly detection**: Signature-based feature engineering
112
+
113
+ ## Limitations
114
+
115
+ - **First import is slow** (~2 min to install Julia environment, one-time)
116
+ - **Not GPU-accelerated** (CPU only, but very fast)
117
+ - **Memory usage**: Uses more RAM than iisignature (but negligible for most applications)
118
+
119
+ ## Requirements
120
+
121
+ - Python ≥3.9
122
+ - NumPy ≥1.20
123
+ - ~500MB disk space (for Julia installation)
124
+
125
+ ## Citation
126
+
127
+ If you use this in research, please cite:
128
+ ```bibtex
129
+ @software{chen_signatures,
130
+ author = {Combi, Alessandro},
131
+ title = {chen-signatures: Fast rough path signatures for Python},
132
+ year = {2025},
133
+ url = {https://github.com/aleCombi/Chen.jl}
134
+ }
135
+ ```
136
+
137
+ ## License
138
+
139
+ MIT License - see [LICENSE](../LICENSE) file.
140
+
141
+ ## Contributing
142
+
143
+ Issues and pull requests welcome at [github.com/aleCombi/Chen.jl](https://github.com/aleCombi/Chen.jl)
@@ -0,0 +1,18 @@
1
+ # python/chen/__init__.py
2
+ from juliacall import Main as jl
3
+ import numpy as np
4
+ from pathlib import Path
5
+
6
+ # Point Julia to the Chen.jl package directory
7
+ chen_path = Path(__file__).parent.parent.parent.absolute()
8
+ chen_path_str = str(chen_path).replace('\\', '/') # Fix Windows paths
9
+ jl.seval(f'import Pkg; Pkg.develop(path="{chen_path_str}")')
10
+ jl.seval("using Chen")
11
+
12
+ def sig(path, m):
13
+ return np.asarray(jl.Chen.sig(np.asarray(path), m))
14
+
15
+ def logsig(path, m):
16
+ d = path.shape[1]
17
+ basis = jl.Chen.prepare(d, m)
18
+ return np.asarray(jl.Chen.logsig(np.asarray(path), basis))
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: chen-signatures
3
+ Version: 0.1.0
4
+ Summary: Fast rough path signatures - 1.6× faster than iisignature
5
+ Author-email: Alessandro Combi <alecombi94@gmail.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/aleCombi/Chen.jl
8
+ Project-URL: Repository, https://github.com/aleCombi/Chen.jl
9
+ Project-URL: Issues, https://github.com/aleCombi/Chen.jl/issues
10
+ Keywords: signatures,rough-paths,time-series,machine-learning
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: juliacall>=0.9.20
24
+ Requires-Dist: numpy>=1.20.0
25
+
26
+ # chen-signatures
27
+
28
+ Fast rough path signatures for Python, powered by Julia.
29
+
30
+ **1.6× faster** than iisignature with support for **modern Python** (3.9-3.13).
31
+
32
+ [![PyPI](https://img.shields.io/pypi/v/chen-signatures)](https://pypi.org/project/chen-signatures/)
33
+ [![Python](https://img.shields.io/pypi/pyversions/chen-signatures)](https://pypi.org/project/chen-signatures/)
34
+
35
+ ## Why chen-signatures?
36
+
37
+ | Feature | chen-signatures | iisignature |
38
+ |---------|-----------------|-------------|
39
+ | **Speed** | 187 ms | 299 ms |
40
+ | **Python 3.10+** | ✅ Yes | ❌ No (≤3.9 only) |
41
+ | **Python 3.13** | ✅ Yes | ❌ No |
42
+ | **Autodiff** | ✅ Yes (ForwardDiff) | ❌ No |
43
+ | **Maintained** | ✅ Active | ⚠️ Unmaintained |
44
+
45
+ *Benchmark: N=1000 points, d=10 dims, level=5*
46
+
47
+ ## Installation
48
+ ```bash
49
+ pip install chen-signatures
50
+ ```
51
+
52
+ First import will automatically install Julia (via juliacall). Takes ~2 minutes once.
53
+
54
+ ## Quick Start
55
+ ```python
56
+ import chen
57
+ import numpy as np
58
+
59
+ # Your time series data
60
+ path = np.random.randn(1000, 10) # 1000 timepoints, 10 dimensions
61
+
62
+ # Compute signature
63
+ signature = chen.sig(path, m=5)
64
+
65
+ # Compute log-signature
66
+ logsignature = chen.logsig(path, m=5)
67
+ ```
68
+
69
+ ## API
70
+
71
+ ### `sig(path, m)`
72
+
73
+ Compute the truncated signature up to level `m`.
74
+
75
+ **Parameters:**
76
+ - `path` : `(N, d)` numpy array - Path data
77
+ - `m` : int - Truncation level
78
+
79
+ **Returns:**
80
+ - `numpy.ndarray` - Flattened signature coefficients
81
+
82
+ **Example:**
83
+ ```python
84
+ import chen
85
+ import numpy as np
86
+
87
+ path = np.array([[0., 0.], [1., 0.], [1., 1.]])
88
+ sig = chen.sig(path, m=3)
89
+ # Returns array of length d + d² + d³ = 2 + 4 + 8 = 14
90
+ ```
91
+
92
+ ### `logsig(path, m)`
93
+
94
+ Compute the log-signature projected onto the Lyndon basis.
95
+
96
+ **Parameters:**
97
+ - `path` : `(N, d)` numpy array - Path data
98
+ - `m` : int - Truncation level
99
+
100
+ **Returns:**
101
+ - `numpy.ndarray` - Log-signature in Lyndon basis
102
+
103
+ **Example:**
104
+ ```python
105
+ logsig = chen.logsig(path, m=5)
106
+ ```
107
+
108
+ ## Supported Types
109
+
110
+ - `float32` and `float64`
111
+ - Any numpy array-like input
112
+
113
+ ## Performance
114
+
115
+ Production-scale benchmark (N=1000, d=10, m=5):
116
+ ```python
117
+ import chen
118
+ import numpy as np
119
+ import time
120
+
121
+ path = np.random.randn(1000, 10)
122
+
123
+ t0 = time.time()
124
+ sig = chen.sig(path, 5)
125
+ print(f"Time: {(time.time()-t0)*1000:.1f} ms")
126
+ # Output: Time: 187.4 ms
127
+ ```
128
+
129
+ Compare to iisignature: **299.3 ms** (1.6× slower)
130
+
131
+ ## Use Cases
132
+
133
+ - **Financial time series**: Extract signature features from price data
134
+ - **Sensor data**: Process multivariate sensor streams
135
+ - **Neural CDEs**: Differentiable features for neural networks
136
+ - **Anomaly detection**: Signature-based feature engineering
137
+
138
+ ## Limitations
139
+
140
+ - **First import is slow** (~2 min to install Julia environment, one-time)
141
+ - **Not GPU-accelerated** (CPU only, but very fast)
142
+ - **Memory usage**: Uses more RAM than iisignature (but negligible for most applications)
143
+
144
+ ## Requirements
145
+
146
+ - Python ≥3.9
147
+ - NumPy ≥1.20
148
+ - ~500MB disk space (for Julia installation)
149
+
150
+ ## Citation
151
+
152
+ If you use this in research, please cite:
153
+ ```bibtex
154
+ @software{chen_signatures,
155
+ author = {Combi, Alessandro},
156
+ title = {chen-signatures: Fast rough path signatures for Python},
157
+ year = {2025},
158
+ url = {https://github.com/aleCombi/Chen.jl}
159
+ }
160
+ ```
161
+
162
+ ## License
163
+
164
+ MIT License - see [LICENSE](../LICENSE) file.
165
+
166
+ ## Contributing
167
+
168
+ Issues and pull requests welcome at [github.com/aleCombi/Chen.jl](https://github.com/aleCombi/Chen.jl)
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ chen/__init__.py
5
+ chen_signatures.egg-info/PKG-INFO
6
+ chen_signatures.egg-info/SOURCES.txt
7
+ chen_signatures.egg-info/dependency_links.txt
8
+ chen_signatures.egg-info/requires.txt
9
+ chen_signatures.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ juliacall>=0.9.20
2
+ numpy>=1.20.0
@@ -0,0 +1,41 @@
1
+ [project]
2
+ name = "chen-signatures"
3
+ version = "0.1.0"
4
+ description = "Fast rough path signatures - 1.6× faster than iisignature"
5
+ readme = "README.md"
6
+ requires-python = ">=3.9"
7
+ license = {text = "MIT"}
8
+ authors = [
9
+ {name = "Alessandro Combi", email = "alecombi94@gmail.com"}
10
+ ]
11
+ keywords = ["signatures", "rough-paths", "time-series", "machine-learning"]
12
+ classifiers = [
13
+ "Development Status :: 4 - Beta",
14
+ "Intended Audience :: Science/Research",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.9",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Programming Language :: Python :: 3.13",
22
+ "Topic :: Scientific/Engineering :: Mathematics",
23
+ ]
24
+
25
+ dependencies = [
26
+ "juliacall>=0.9.20",
27
+ "numpy>=1.20.0",
28
+ ]
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/aleCombi/Chen.jl"
32
+ Repository = "https://github.com/aleCombi/Chen.jl"
33
+ Issues = "https://github.com/aleCombi/Chen.jl/issues"
34
+
35
+ [build-system]
36
+ requires = ["setuptools>=45", "wheel"]
37
+ build-backend = "setuptools.build_meta"
38
+
39
+ [tool.setuptools.packages.find]
40
+ where = ["."]
41
+ include = ["chen*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,8 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ packages=find_packages(),
5
+ package_data={
6
+ 'chen': ['*.py'],
7
+ },
8
+ )