tsfx 0.1.2__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.
Files changed (46) hide show
  1. tsfx-0.1.2/.cargo/config.toml +2 -0
  2. tsfx-0.1.2/.github/workflows/CI.yml +134 -0
  3. tsfx-0.1.2/.gitignore +180 -0
  4. tsfx-0.1.2/.pre-commit-config.yaml +70 -0
  5. tsfx-0.1.2/.tsfx-config.toml +216 -0
  6. tsfx-0.1.2/Cargo.lock +2484 -0
  7. tsfx-0.1.2/Cargo.toml +53 -0
  8. tsfx-0.1.2/PKG-INFO +247 -0
  9. tsfx-0.1.2/README.md +217 -0
  10. tsfx-0.1.2/benches/bench_main.rs +10 -0
  11. tsfx-0.1.2/benches/benchmarks/extract_efficient.rs +41 -0
  12. tsfx-0.1.2/benches/benchmarks/extract_efficient_with_time.rs +56 -0
  13. tsfx-0.1.2/benches/benchmarks/extract_minimal.rs +41 -0
  14. tsfx-0.1.2/benches/benchmarks/extract_minimal_with_time.rs +56 -0
  15. tsfx-0.1.2/benches/benchmarks/mod.rs +4 -0
  16. tsfx-0.1.2/examples/extract_from_file.py +35 -0
  17. tsfx-0.1.2/examples/extract_simple.py +59 -0
  18. tsfx-0.1.2/examples/vector_search.ipynb +347 -0
  19. tsfx-0.1.2/pyproject.toml +116 -0
  20. tsfx-0.1.2/python/tsfx/__init__.py +2 -0
  21. tsfx-0.1.2/python/tsfx/_tsfx.py +29 -0
  22. tsfx-0.1.2/python/tsfx/py.typed +0 -0
  23. tsfx-0.1.2/python/tsfx/tsfx.pyi +38 -0
  24. tsfx-0.1.2/python_benchmarks/efficient.json +173 -0
  25. tsfx-0.1.2/python_benchmarks/efficient_bench.py +74 -0
  26. tsfx-0.1.2/python_benchmarks/minimal_bench.py +54 -0
  27. tsfx-0.1.2/python_tests/data/.tsfx-config-empty.toml +0 -0
  28. tsfx-0.1.2/python_tests/data/.tsfx-config-test.toml +195 -0
  29. tsfx-0.1.2/python_tests/test_config.py +24 -0
  30. tsfx-0.1.2/python_tests/test_features.py +995 -0
  31. tsfx-0.1.2/rust-toolchain.toml +2 -0
  32. tsfx-0.1.2/src/error.rs +19 -0
  33. tsfx-0.1.2/src/extract.rs +239 -0
  34. tsfx-0.1.2/src/feature_extractors/extractors.rs +8 -0
  35. tsfx-0.1.2/src/feature_extractors/extras.rs +1723 -0
  36. tsfx-0.1.2/src/feature_extractors/high_comp_cost.rs +64 -0
  37. tsfx-0.1.2/src/feature_extractors/minimal.rs +303 -0
  38. tsfx-0.1.2/src/feature_extractors/mod.rs +4 -0
  39. tsfx-0.1.2/src/html/docs-header.html +15 -0
  40. tsfx-0.1.2/src/lib.rs +147 -0
  41. tsfx-0.1.2/src/utils/mod.rs +1 -0
  42. tsfx-0.1.2/src/utils/toml_reader.rs +1049 -0
  43. tsfx-0.1.2/test_data/all_stocks_5yr.csv +619041 -0
  44. tsfx-0.1.2/tests/config.rs +61 -0
  45. tsfx-0.1.2/tests/data/.tsfx-config-empty.toml +0 -0
  46. tsfx-0.1.2/tests/data/.tsfx-config-test.toml +195 -0
@@ -0,0 +1,2 @@
1
+ [build]
2
+ rustdocflags = [ "--html-in-header", "./src/html/docs-header.html" ]
@@ -0,0 +1,134 @@
1
+ # This file is autogenerated by maturin v1.7.1
2
+ # To update, run
3
+ #
4
+ # maturin generate-ci github --platform windows macos musllinux
5
+ #
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ - master
13
+ tags:
14
+ - '*'
15
+ pull_request:
16
+ workflow_dispatch:
17
+
18
+ permissions:
19
+ contents: read
20
+
21
+ jobs:
22
+ musllinux:
23
+ runs-on: ${{ matrix.platform.runner }}
24
+ strategy:
25
+ matrix:
26
+ platform:
27
+ - runner: ubuntu-latest
28
+ target: x86_64
29
+ - runner: ubuntu-latest
30
+ target: x86
31
+ - runner: ubuntu-latest
32
+ target: aarch64
33
+ - runner: ubuntu-latest
34
+ target: armv7
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - uses: actions/setup-python@v5
38
+ with:
39
+ python-version: 3.x
40
+ - name: Build wheels
41
+ uses: PyO3/maturin-action@v1
42
+ with:
43
+ target: ${{ matrix.platform.target }}
44
+ args: --release --out dist --find-interpreter
45
+ sccache: 'true'
46
+ manylinux: musllinux_1_2
47
+ - name: Upload wheels
48
+ uses: actions/upload-artifact@v4
49
+ with:
50
+ name: wheels-musllinux-${{ matrix.platform.target }}
51
+ path: dist
52
+
53
+ windows:
54
+ runs-on: ${{ matrix.platform.runner }}
55
+ strategy:
56
+ matrix:
57
+ platform:
58
+ - runner: windows-latest
59
+ target: x64
60
+ - runner: windows-latest
61
+ target: x86
62
+ steps:
63
+ - uses: actions/checkout@v4
64
+ - uses: actions/setup-python@v5
65
+ with:
66
+ python-version: 3.x
67
+ architecture: ${{ matrix.platform.target }}
68
+ - name: Build wheels
69
+ uses: PyO3/maturin-action@v1
70
+ with:
71
+ target: ${{ matrix.platform.target }}
72
+ args: --release --out dist --find-interpreter
73
+ sccache: 'true'
74
+ - name: Upload wheels
75
+ uses: actions/upload-artifact@v4
76
+ with:
77
+ name: wheels-windows-${{ matrix.platform.target }}
78
+ path: dist
79
+
80
+ macos:
81
+ runs-on: ${{ matrix.platform.runner }}
82
+ strategy:
83
+ matrix:
84
+ platform:
85
+ - runner: macos-12
86
+ target: x86_64
87
+ - runner: macos-14
88
+ target: aarch64
89
+ steps:
90
+ - uses: actions/checkout@v4
91
+ - uses: actions/setup-python@v5
92
+ with:
93
+ python-version: 3.x
94
+ - name: Build wheels
95
+ uses: PyO3/maturin-action@v1
96
+ with:
97
+ target: ${{ matrix.platform.target }}
98
+ args: --release --out dist --find-interpreter
99
+ sccache: 'true'
100
+ - name: Upload wheels
101
+ uses: actions/upload-artifact@v4
102
+ with:
103
+ name: wheels-macos-${{ matrix.platform.target }}
104
+ path: dist
105
+
106
+ sdist:
107
+ runs-on: ubuntu-latest
108
+ steps:
109
+ - uses: actions/checkout@v4
110
+ - name: Build sdist
111
+ uses: PyO3/maturin-action@v1
112
+ with:
113
+ command: sdist
114
+ args: --out dist
115
+ - name: Upload sdist
116
+ uses: actions/upload-artifact@v4
117
+ with:
118
+ name: wheels-sdist
119
+ path: dist
120
+
121
+ release:
122
+ name: Release
123
+ runs-on: ubuntu-latest
124
+ if: "startsWith(github.ref, 'refs/tags/')"
125
+ needs: [musllinux, windows, macos, sdist]
126
+ steps:
127
+ - uses: actions/download-artifact@v4
128
+ - name: Publish to PyPI
129
+ uses: PyO3/maturin-action@v1
130
+ env:
131
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
132
+ with:
133
+ command: upload
134
+ args: --non-interactive --skip-existing wheels-*/*
tsfx-0.1.2/.gitignore ADDED
@@ -0,0 +1,180 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
161
+
162
+ # Generated by Cargo
163
+ # will have compiled files and executables
164
+ debug/
165
+ target/
166
+
167
+ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
168
+ # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
169
+ Cargo.lock
170
+
171
+ # These are backup files generated by rustfmt
172
+ **/*.rs.bk
173
+
174
+ # MSVC Windows builds of rustc generate these, which store debugging information
175
+ *.pdb
176
+ extra
177
+ tolkai_stuff
178
+ *.bak
179
+ pyrightconfig.json
180
+ .zed/
@@ -0,0 +1,70 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: pytest-check
5
+ name: pytest-check
6
+ entry: pytest
7
+ language: system
8
+ pass_filenames: false
9
+ always_run: true
10
+ - repo: local
11
+ hooks:
12
+ - id: jupyter-nb-clear-output
13
+ name: jupyter-nb-clear-output
14
+ files: \.ipynb$
15
+ stages: [commit]
16
+ language: system
17
+ entry: jupyter nbconvert --ClearOutputPreprocessor.enabled=True --inplace
18
+ - repo: https://github.com/pre-commit/pre-commit-hooks
19
+ rev: v4.6.0
20
+ hooks:
21
+ - id: trailing-whitespace
22
+ - id: end-of-file-fixer
23
+ - id: check-yaml
24
+ - id: check-added-large-files
25
+ - repo: https://github.com/pre-commit/mirrors-mypy
26
+ rev: v1.10.0 # Use the sha / tag you want to point at
27
+ hooks:
28
+ - id: mypy
29
+ files: ^src/
30
+ args: []
31
+ - repo: https://github.com/asottile/setup-cfg-fmt
32
+ rev: v2.5.0
33
+ hooks:
34
+ - id: setup-cfg-fmt
35
+ - repo: https://github.com/asottile/add-trailing-comma
36
+ rev: v3.1.0
37
+ hooks:
38
+ - id: add-trailing-comma
39
+ args: [--py36-plus]
40
+ - repo: https://github.com/charliermarsh/ruff-pre-commit
41
+ rev: "v0.4.2"
42
+ hooks:
43
+ - id: ruff
44
+ args: ["--fix"]
45
+ - id: ruff-format
46
+ - repo: https://github.com/doublify/pre-commit-rust
47
+ rev: v1.0
48
+ hooks:
49
+ - id: fmt
50
+ name: fmt
51
+ description: Format files with cargo fmt.
52
+ entry: cargo fmt
53
+ language: system
54
+ types: [rust]
55
+ args: ["--"]
56
+ - id: cargo-check
57
+ name: cargo check
58
+ description: Check the package for errors.
59
+ entry: cargo check
60
+ language: system
61
+ types: [rust]
62
+ pass_filenames: false
63
+ - id: clippy
64
+ name: clippy
65
+ description: Lint rust sources
66
+ entry: cargo clippy
67
+ language: system
68
+ args: ["--", "-D", "warnings"]
69
+ types: [rust]
70
+ pass_filenames: false
@@ -0,0 +1,216 @@
1
+ [length]
2
+
3
+ [sum_values]
4
+
5
+ [mean]
6
+
7
+ [median]
8
+
9
+ [minimum]
10
+
11
+ [maximum]
12
+
13
+ [standard_deviation]
14
+
15
+ [variance]
16
+
17
+ [skewness]
18
+
19
+ [root_mean_square]
20
+
21
+ [kurtosis]
22
+
23
+ [absolute_energy]
24
+
25
+ [mean_absolute_change]
26
+
27
+ [linear_trend]
28
+
29
+ [variance_larger_than_standard_deviation]
30
+
31
+ [ratio_beyond_r_sigma]
32
+ parameters = [
33
+ { r = 0.5 },
34
+ { r = 1.0 },
35
+ { r = 1.5 },
36
+ { r = 2.0 },
37
+ { r = 2.5 },
38
+ { r = 3.0 },
39
+ { r = 5.0 },
40
+ { r = 6.0 },
41
+ { r = 7.0 },
42
+ { r = 10.0 },
43
+ ]
44
+
45
+ [large_standard_deviation]
46
+ parameters = [
47
+ { r = 0.05 },
48
+ { r = 0.1 },
49
+ { r = 0.15 },
50
+ { r = 0.2 },
51
+ { r = 0.25 },
52
+ { r = 0.3 },
53
+ { r = 0.35 },
54
+ { r = 0.4 },
55
+ { r = 0.45 },
56
+ { r = 0.5 },
57
+ { r = 0.55 },
58
+ { r = 0.6 },
59
+ { r = 0.65 },
60
+ { r = 0.7 },
61
+ { r = 0.75 },
62
+ { r = 0.8 },
63
+ { r = 0.85 },
64
+ { r = 0.9 },
65
+ { r = 0.95 },
66
+ ]
67
+
68
+ [symmetry_looking]
69
+ parameters = [
70
+ { r = 0.05 },
71
+ { r = 0.1 },
72
+ { r = 0.15 },
73
+ { r = 0.2 },
74
+ { r = 0.25 },
75
+ { r = 0.3 },
76
+ { r = 0.35 },
77
+ { r = 0.4 },
78
+ { r = 0.45 },
79
+ { r = 0.5 },
80
+ { r = 0.55 },
81
+ { r = 0.6 },
82
+ { r = 0.65 },
83
+ { r = 0.7 },
84
+ { r = 0.75 },
85
+ { r = 0.8 },
86
+ { r = 0.85 },
87
+ { r = 0.9 },
88
+ { r = 0.95 },
89
+ ]
90
+
91
+ [has_duplicate_max]
92
+
93
+ [has_duplicate_min]
94
+
95
+ [cid_ce]
96
+ parameters = [{ normalize = true }, { normalize = false }]
97
+
98
+ [absolute_maximum]
99
+
100
+ [absolute_sum_of_changes]
101
+
102
+ [count_above_mean]
103
+
104
+ [count_below_mean]
105
+
106
+ [count_above]
107
+ parameters = [{ t = 0.0 }]
108
+
109
+ [count_below]
110
+ parameters = [{ t = 0.0 }]
111
+
112
+ [first_location_of_maximum]
113
+
114
+ [first_location_of_minimum]
115
+
116
+ [last_location_of_maximum]
117
+
118
+ [last_location_of_minimum]
119
+
120
+ [longest_strike_above_mean]
121
+
122
+ [longest_strike_below_mean]
123
+
124
+ [has_duplicate]
125
+
126
+ [variation_coefficient]
127
+
128
+ [mean_change]
129
+
130
+ [ratio_value_number_to_time_series_length]
131
+
132
+ [sum_of_reoccurring_values]
133
+
134
+ [sum_of_reoccurring_data_points]
135
+
136
+ [percentage_of_reoccurring_values_to_all_values]
137
+
138
+ [percentage_of_reoccurring_values_to_all_datapoints]
139
+
140
+ [agg_linear_trend]
141
+ parameters = [
142
+ { chunk_size = 5, aggregator = "mean" },
143
+ { chunk_size = 5, aggregator = "min" },
144
+ { chunk_size = 5, aggregator = "max" },
145
+ { chunk_size = 5, aggregator = "var" },
146
+ { chunk_size = 10, aggregator = "mean" },
147
+ { chunk_size = 10, aggregator = "min" },
148
+ { chunk_size = 10, aggregator = "max" },
149
+ { chunk_size = 10, aggregator = "var" },
150
+ { chunk_size = 50, aggregator = "mean" },
151
+ { chunk_size = 50, aggregator = "min" },
152
+ { chunk_size = 50, aggregator = "max" },
153
+ { chunk_size = 50, aggregator = "var" },
154
+ ]
155
+
156
+
157
+ [mean_n_absolute_max]
158
+ parameters = [{ n = 7 }]
159
+
160
+ [autocorrelation]
161
+ parameters = [
162
+ { lag = 0 },
163
+ { lag = 1 },
164
+ { lag = 2 },
165
+ { lag = 3 },
166
+ { lag = 4 },
167
+ { lag = 5 },
168
+ { lag = 6 },
169
+ { lag = 7 },
170
+ { lag = 8 },
171
+ { lag = 9 },
172
+ ]
173
+
174
+ [quantile]
175
+ parameters = [
176
+ { q = 0.1 },
177
+ { q = 0.2 },
178
+ { q = 0.3 },
179
+ { q = 0.4 },
180
+ { q = 0.6 },
181
+ { q = 0.7 },
182
+ { q = 0.8 },
183
+ { q = 0.9 },
184
+ ]
185
+
186
+ [number_crossing_m]
187
+ parameters = [{ m = -1.0 }, { m = 0.0 }, { m = 1.0 }]
188
+
189
+ [range_count]
190
+ parameters = [
191
+ { min = -1.0, max = 1.0 },
192
+ { min = -1_000_000_000_000.0, max = 0.0 },
193
+ { min = 0.0, max = 1_000_000_000_000.0 },
194
+ ]
195
+
196
+ [index_mass_quantile]
197
+ parameters = [
198
+ { q = 0.1 },
199
+ { q = 0.2 },
200
+ { q = 0.3 },
201
+ { q = 0.4 },
202
+ { q = 0.5 },
203
+ { q = 0.6 },
204
+ { q = 0.7 },
205
+ { q = 0.8 },
206
+ { q = 0.9 },
207
+ ]
208
+
209
+ [c3]
210
+ parameters = [{ lag = 1 }, { lag = 2 }, { lag = 3 }]
211
+
212
+ [time_reversal_asymmetry_statistic]
213
+ parameters = [{ lag = 1 }, { lag = 2 }, { lag = 3 }]
214
+
215
+ [number_peaks]
216
+ parameters = [{ n = 1 }, { n = 3 }, { n = 5 }, { n = 10 }, { n = 50 }]