polars-talib 0.2.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.
- polars_talib-0.2.0/.agents/plugins/marketplace.json +20 -0
- polars_talib-0.2.0/.claude-plugin/marketplace.json +16 -0
- polars_talib-0.2.0/.cursor-plugin/marketplace.json +16 -0
- polars_talib-0.2.0/.gitattributes +1 -0
- polars_talib-0.2.0/.github/workflows/CI.yml +219 -0
- polars_talib-0.2.0/.gitignore +176 -0
- polars_talib-0.2.0/.vscode/settings.json +7 -0
- polars_talib-0.2.0/.vscode/snippets.code-snippets +48 -0
- polars_talib-0.2.0/Cargo.lock +1965 -0
- polars_talib-0.2.0/Cargo.toml +29 -0
- polars_talib-0.2.0/LICENSE +21 -0
- polars_talib-0.2.0/Makefile +5 -0
- polars_talib-0.2.0/PKG-INFO +183 -0
- polars_talib-0.2.0/README.md +168 -0
- polars_talib-0.2.0/docs/benchmarks/0.1.6-linux-x64.json +1388 -0
- polars_talib-0.2.0/docs/benchmarks/0.2.0-linux-x64.json +2072 -0
- polars_talib-0.2.0/docs/benchmarks/review-followup/after-first.json +56 -0
- polars_talib-0.2.0/docs/benchmarks/review-followup/after-second.json +56 -0
- polars_talib-0.2.0/docs/benchmarks/review-followup/before-first.json +56 -0
- polars_talib-0.2.0/docs/benchmarks/review-followup/before-second.json +56 -0
- polars_talib-0.2.0/docs/indicators.md +257 -0
- polars_talib-0.2.0/docs/performance.md +151 -0
- polars_talib-0.2.0/docs/skills.md +158 -0
- polars_talib-0.2.0/docs/upgrade-0.2.0.md +125 -0
- polars_talib-0.2.0/examples/basic.ipynb +777 -0
- polars_talib-0.2.0/examples/bench.ipynb +394 -0
- polars_talib-0.2.0/examples/nasdaq_screener.csv +7161 -0
- polars_talib-0.2.0/plugins/polars-talib/.claude-plugin/plugin.json +19 -0
- polars_talib-0.2.0/plugins/polars-talib/.codex-plugin/plugin.json +32 -0
- polars_talib-0.2.0/plugins/polars-talib/.cursor-plugin/plugin.json +26 -0
- polars_talib-0.2.0/plugins/polars-talib/LICENSE +21 -0
- polars_talib-0.2.0/plugins/polars-talib/skills/polars-talib/SKILL.md +50 -0
- polars_talib-0.2.0/plugins/polars-talib/skills/polars-talib/reference/functions.md +270 -0
- polars_talib-0.2.0/plugins/polars-talib/skills/polars-talib/reference/patterns.md +103 -0
- polars_talib-0.2.0/pyproject.toml +43 -0
- polars_talib-0.2.0/python/polars_talib/__init__.py +6549 -0
- polars_talib-0.2.0/python/polars_talib/_generated.py +445 -0
- polars_talib-0.2.0/python/polars_talib/_param_types.py +338 -0
- polars_talib-0.2.0/python/polars_talib/py.typed +0 -0
- polars_talib-0.2.0/python/polars_talib/utils.py +56 -0
- polars_talib-0.2.0/scripts/api.json +4560 -0
- polars_talib-0.2.0/scripts/benchmark.py +69 -0
- polars_talib-0.2.0/scripts/check_build_overrides.py +77 -0
- polars_talib-0.2.0/scripts/check_native_plugins.py +130 -0
- polars_talib-0.2.0/scripts/compare_benchmarks.py +69 -0
- polars_talib-0.2.0/scripts/extract_api.py +57 -0
- polars_talib-0.2.0/scripts/generate_indicators.py +251 -0
- polars_talib-0.2.0/scripts/generate_skill_reference.py +83 -0
- polars_talib-0.2.0/scripts/install_skill.py +23 -0
- polars_talib-0.2.0/src/cycle.rs +88 -0
- polars_talib-0.2.0/src/generated.rs +904 -0
- polars_talib-0.2.0/src/lib.rs +68 -0
- polars_talib-0.2.0/src/math.rs +419 -0
- polars_talib-0.2.0/src/momentum.rs +540 -0
- polars_talib-0.2.0/src/overlap.rs +267 -0
- polars_talib-0.2.0/src/pattern.rs +1250 -0
- polars_talib-0.2.0/src/statistic.rs +141 -0
- polars_talib-0.2.0/src/transform.rs +75 -0
- polars_talib-0.2.0/src/utils.rs +55 -0
- polars_talib-0.2.0/src/volatility.rs +60 -0
- polars_talib-0.2.0/src/volume.rs +57 -0
- polars_talib-0.2.0/talib/Cargo.lock +426 -0
- polars_talib-0.2.0/talib/Cargo.toml +17 -0
- polars_talib-0.2.0/talib/README.md +59 -0
- polars_talib-0.2.0/talib/examples/rsi.rs +27 -0
- polars_talib-0.2.0/talib/examples/sar.rs +36 -0
- polars_talib-0.2.0/talib/src/common.rs +42 -0
- polars_talib-0.2.0/talib/src/cycle.rs +268 -0
- polars_talib-0.2.0/talib/src/generated.rs +1990 -0
- polars_talib-0.2.0/talib/src/lib.rs +12 -0
- polars_talib-0.2.0/talib/src/math.rs +1224 -0
- polars_talib-0.2.0/talib/src/momentum.rs +1717 -0
- polars_talib-0.2.0/talib/src/overlap.rs +941 -0
- polars_talib-0.2.0/talib/src/pattern.rs +3490 -0
- polars_talib-0.2.0/talib/src/statistic.rs +500 -0
- polars_talib-0.2.0/talib/src/transform.rs +201 -0
- polars_talib-0.2.0/talib/src/utils.rs +178 -0
- polars_talib-0.2.0/talib/src/volatility.rs +170 -0
- polars_talib-0.2.0/talib/src/volume.rs +165 -0
- polars_talib-0.2.0/talib/tests/generated.rs +22 -0
- polars_talib-0.2.0/talib-sys/Cargo.toml +25 -0
- polars_talib-0.2.0/talib-sys/README.md +17 -0
- polars_talib-0.2.0/talib-sys/build.rs +156 -0
- polars_talib-0.2.0/talib-sys/examples/atr.rs +63 -0
- polars_talib-0.2.0/talib-sys/examples/rsi.rs +49 -0
- polars_talib-0.2.0/talib-sys/examples/sma.rs +53 -0
- polars_talib-0.2.0/talib-sys/src/bindings.rs +19619 -0
- polars_talib-0.2.0/talib-sys/src/lib.rs +5 -0
- polars_talib-0.2.0/talib-sys/vendor/TA-Lib-LICENSE +26 -0
- polars_talib-0.2.0/talib-sys/vendor/ta-lib-0.8.1-src.tar.gz +0 -0
- polars_talib-0.2.0/talib-sys/wrapper.h +1 -0
- polars_talib-0.2.0/tests/conftest.py +23 -0
- polars_talib-0.2.0/tests/test_bench.py +53 -0
- polars_talib-0.2.0/tests/test_complete_api.py +279 -0
- polars_talib-0.2.0/tests/test_nan.py +396 -0
- polars_talib-0.2.0/tests/test_plugin_packaging.py +35 -0
- polars_talib-0.2.0/tests/test_regressions.py +96 -0
- polars_talib-0.2.0/tests/test_release_tools.py +109 -0
- polars_talib-0.2.0/tests/test_ta.py +2305 -0
- polars_talib-0.2.0/uv.lock +532 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "polars-ta-extension",
|
|
3
|
+
"interface": {
|
|
4
|
+
"displayName": "Polars Ta Extension"
|
|
5
|
+
},
|
|
6
|
+
"plugins": [
|
|
7
|
+
{
|
|
8
|
+
"name": "polars-talib",
|
|
9
|
+
"source": {
|
|
10
|
+
"source": "local",
|
|
11
|
+
"path": "./plugins/polars-talib"
|
|
12
|
+
},
|
|
13
|
+
"policy": {
|
|
14
|
+
"installation": "AVAILABLE",
|
|
15
|
+
"authentication": "ON_INSTALL"
|
|
16
|
+
},
|
|
17
|
+
"category": "Productivity"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "polars-ta-extension",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Yvictor",
|
|
5
|
+
"url": "https://github.com/Yvictor"
|
|
6
|
+
},
|
|
7
|
+
"description": "Polars TA-Lib coding skills.",
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"name": "polars-talib",
|
|
11
|
+
"source": "./plugins/polars-talib",
|
|
12
|
+
"description": "Use all 201 TA-Lib indicators in native Polars expressions, grouped time series and lazy pipelines.",
|
|
13
|
+
"version": "0.2.0"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "polars-ta-extension",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Yvictor"
|
|
5
|
+
},
|
|
6
|
+
"metadata": {
|
|
7
|
+
"description": "Polars TA-Lib coding skills."
|
|
8
|
+
},
|
|
9
|
+
"plugins": [
|
|
10
|
+
{
|
|
11
|
+
"name": "polars-talib",
|
|
12
|
+
"source": "plugins/polars-talib",
|
|
13
|
+
"description": "Use all 201 TA-Lib indicators in native Polars expressions, grouped time series and lazy pipelines."
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
examples/* linguist-documentation
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [master, main]
|
|
6
|
+
tags: ['v*', '0.*']
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: ci-${{ github.ref }}
|
|
15
|
+
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
PYO3_USE_ABI3_FORWARD_COMPATIBILITY: '1'
|
|
19
|
+
CARGO_BUILD_JOBS: '4'
|
|
20
|
+
POLARS_MAX_THREADS: '4'
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
wheels:
|
|
24
|
+
name: Wheel / ${{ matrix.name }}
|
|
25
|
+
runs-on: ${{ matrix.runner }}
|
|
26
|
+
strategy:
|
|
27
|
+
fail-fast: false
|
|
28
|
+
matrix:
|
|
29
|
+
include:
|
|
30
|
+
- {name: linux-x64, runner: ubuntu-24.04, target: x86_64-unknown-linux-gnu, manylinux: '2_28', python-arch: x64}
|
|
31
|
+
- {name: linux-arm64, runner: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, manylinux: '2_28', python-arch: arm64}
|
|
32
|
+
- {name: musl-x64, runner: ubuntu-24.04, target: x86_64-unknown-linux-musl, manylinux: musllinux_1_2, python-arch: x64}
|
|
33
|
+
- {name: musl-arm64, runner: ubuntu-24.04-arm, target: aarch64-unknown-linux-musl, manylinux: musllinux_1_2, python-arch: arm64}
|
|
34
|
+
- {name: macos-x64, runner: macos-15-intel, target: x86_64-apple-darwin, manylinux: 'off', python-arch: x64}
|
|
35
|
+
- {name: macos-arm64, runner: macos-15, target: aarch64-apple-darwin, manylinux: 'off', python-arch: arm64}
|
|
36
|
+
- {name: windows-x64, runner: windows-2025, target: x86_64-pc-windows-msvc, manylinux: 'off', python-arch: x64}
|
|
37
|
+
- {name: windows-arm64, runner: windows-11-arm, target: aarch64-pc-windows-msvc, manylinux: 'off', python-arch: arm64}
|
|
38
|
+
steps:
|
|
39
|
+
- uses: actions/checkout@v6
|
|
40
|
+
- uses: actions/setup-python@v6
|
|
41
|
+
with:
|
|
42
|
+
python-version: '3.12'
|
|
43
|
+
architecture: ${{ matrix.python-arch }}
|
|
44
|
+
- uses: dtolnay/rust-toolchain@1.90.0
|
|
45
|
+
with:
|
|
46
|
+
components: rustfmt
|
|
47
|
+
- uses: astral-sh/setup-uv@v8.2.0
|
|
48
|
+
- name: CMake (native hosts)
|
|
49
|
+
if: runner.os != 'Linux'
|
|
50
|
+
run: uv pip install --system 'cmake>=4.2,<5'
|
|
51
|
+
- name: Build self-contained release wheel
|
|
52
|
+
uses: PyO3/maturin-action@v1.46.0
|
|
53
|
+
with:
|
|
54
|
+
target: ${{ matrix.target }}
|
|
55
|
+
manylinux: ${{ matrix.manylinux }}
|
|
56
|
+
args: --release --locked --out dist
|
|
57
|
+
sccache: 'true'
|
|
58
|
+
rust-toolchain: '1.90.0'
|
|
59
|
+
before-script-linux: |
|
|
60
|
+
if test -x /opt/python/cp312-cp312/bin/python; then
|
|
61
|
+
export PATH=/opt/python/cp312-cp312/bin:$PATH
|
|
62
|
+
fi
|
|
63
|
+
if command -v apk >/dev/null; then
|
|
64
|
+
apk add --no-cache cmake make
|
|
65
|
+
else
|
|
66
|
+
python3 -m pip install 'cmake>=4.2,<5'
|
|
67
|
+
fi
|
|
68
|
+
- name: Test installed wheel (native)
|
|
69
|
+
if: ${{ !startsWith(matrix.name, 'musl-') }}
|
|
70
|
+
shell: bash
|
|
71
|
+
run: |
|
|
72
|
+
uv venv .wheel-test
|
|
73
|
+
uv pip install --python .wheel-test dist/*.whl 'polars==1.44.2' 'TA-Lib==0.8.1' numpy pytest pytest-benchmark
|
|
74
|
+
uv run --no-project --python .wheel-test python -m pytest tests --ignore=tests/test_bench.py -q
|
|
75
|
+
uv run --no-project --python .wheel-test python scripts/install_skill.py --agent codex --project .skill-test
|
|
76
|
+
- name: Test installed wheel (Alpine, native CPU)
|
|
77
|
+
if: startsWith(matrix.name, 'musl-')
|
|
78
|
+
run: |
|
|
79
|
+
docker run --rm -v "$PWD:/work" -w /work python:3.12-alpine sh -ec '
|
|
80
|
+
pip install --only-binary=:all: dist/*.whl "polars==1.44.2" "TA-Lib==0.8.1" numpy pytest pytest-benchmark
|
|
81
|
+
python -m pytest tests --ignore=tests/test_bench.py -q
|
|
82
|
+
'
|
|
83
|
+
- uses: actions/upload-artifact@v7
|
|
84
|
+
with:
|
|
85
|
+
name: wheels-${{ matrix.name }}
|
|
86
|
+
path: dist/*.whl
|
|
87
|
+
if-no-files-found: error
|
|
88
|
+
|
|
89
|
+
native-plugins:
|
|
90
|
+
name: Native Claude Code and Codex plugins
|
|
91
|
+
runs-on: ubuntu-24.04
|
|
92
|
+
steps:
|
|
93
|
+
- uses: actions/checkout@v6
|
|
94
|
+
- uses: actions/setup-node@v6
|
|
95
|
+
with:
|
|
96
|
+
node-version: '24'
|
|
97
|
+
- uses: actions/setup-python@v6
|
|
98
|
+
with:
|
|
99
|
+
python-version: '3.12'
|
|
100
|
+
- name: Install tested native CLIs
|
|
101
|
+
run: npm install --global @openai/codex@0.155.1 @anthropic-ai/claude-code@2.1.278
|
|
102
|
+
- name: Install and discover plugin skills with native CLIs
|
|
103
|
+
run: python scripts/check_native_plugins.py
|
|
104
|
+
|
|
105
|
+
compatibility:
|
|
106
|
+
name: Python ${{ matrix.python }} / Polars ${{ matrix.polars }}
|
|
107
|
+
needs: wheels
|
|
108
|
+
runs-on: ubuntu-24.04
|
|
109
|
+
strategy:
|
|
110
|
+
fail-fast: false
|
|
111
|
+
matrix:
|
|
112
|
+
python: ['3.10', '3.11', '3.13', '3.14']
|
|
113
|
+
polars: ['1.20.0', '1.44.2']
|
|
114
|
+
steps:
|
|
115
|
+
- uses: actions/checkout@v6
|
|
116
|
+
- uses: actions/setup-python@v6
|
|
117
|
+
with:
|
|
118
|
+
python-version: ${{ matrix.python }}
|
|
119
|
+
- uses: actions/download-artifact@v7
|
|
120
|
+
with:
|
|
121
|
+
name: wheels-linux-x64
|
|
122
|
+
path: dist
|
|
123
|
+
- run: python -m pip install dist/*.whl 'polars==${{ matrix.polars }}' 'TA-Lib==0.8.1' numpy pytest pytest-benchmark
|
|
124
|
+
- run: python -m pytest tests --ignore=tests/test_bench.py -q
|
|
125
|
+
|
|
126
|
+
source:
|
|
127
|
+
name: Source distribution and generators
|
|
128
|
+
runs-on: ubuntu-24.04
|
|
129
|
+
steps:
|
|
130
|
+
- uses: actions/checkout@v6
|
|
131
|
+
- uses: dtolnay/rust-toolchain@1.90.0
|
|
132
|
+
with:
|
|
133
|
+
components: rustfmt
|
|
134
|
+
- uses: actions/setup-python@v6
|
|
135
|
+
with:
|
|
136
|
+
python-version: '3.12'
|
|
137
|
+
- uses: astral-sh/setup-uv@v8.2.0
|
|
138
|
+
- run: uv pip install --system maturin 'cmake>=4.2,<5' pytest numpy 'TA-Lib==0.8.1' 'polars==1.44.2' pytest-benchmark
|
|
139
|
+
- name: Check Python dependency lock
|
|
140
|
+
run: uv lock --check
|
|
141
|
+
- name: Check generated wrappers are current
|
|
142
|
+
run: |
|
|
143
|
+
python scripts/generate_indicators.py
|
|
144
|
+
python scripts/generate_skill_reference.py
|
|
145
|
+
git diff --exit-code -- src/generated.rs talib/src/generated.rs python/polars_talib/_generated.py python/polars_talib/_param_types.py docs/indicators.md plugins/polars-talib/skills/polars-talib/reference/functions.md
|
|
146
|
+
- name: Rust crate tests
|
|
147
|
+
run: cargo test --manifest-path talib/Cargo.toml
|
|
148
|
+
- name: Validate system-library overrides
|
|
149
|
+
run: python scripts/check_build_overrides.py
|
|
150
|
+
- name: Build source distribution and install it without system TA-Lib
|
|
151
|
+
run: |
|
|
152
|
+
maturin sdist --out dist
|
|
153
|
+
uv pip install --system dist/*.tar.gz
|
|
154
|
+
python -m pytest tests --ignore=tests/test_bench.py -q
|
|
155
|
+
- uses: actions/upload-artifact@v7
|
|
156
|
+
with:
|
|
157
|
+
name: sdist
|
|
158
|
+
path: dist/*.tar.gz
|
|
159
|
+
|
|
160
|
+
benchmark:
|
|
161
|
+
name: Release benchmark
|
|
162
|
+
needs: wheels
|
|
163
|
+
runs-on: ubuntu-24.04
|
|
164
|
+
steps:
|
|
165
|
+
- uses: actions/checkout@v6
|
|
166
|
+
- uses: actions/setup-python@v6
|
|
167
|
+
with:
|
|
168
|
+
python-version: '3.12'
|
|
169
|
+
- uses: actions/download-artifact@v7
|
|
170
|
+
with:
|
|
171
|
+
name: wheels-linux-x64
|
|
172
|
+
path: dist
|
|
173
|
+
- uses: astral-sh/setup-uv@v8.2.0
|
|
174
|
+
# Informational: shared runners are too noisy to gate a release on a
|
|
175
|
+
# fixed regression threshold. The comparison and raw samples are kept as
|
|
176
|
+
# a job summary and artifact for humans to judge.
|
|
177
|
+
- name: Compare release wheels on the same runner
|
|
178
|
+
run: |
|
|
179
|
+
uv venv .benchmark-base
|
|
180
|
+
uv venv .benchmark-candidate
|
|
181
|
+
uv pip install --python .benchmark-base 'polars-talib==0.1.6' 'polars==1.44.2' 'numpy==2.5.3'
|
|
182
|
+
uv pip install --python .benchmark-candidate dist/*.whl 'polars==1.44.2' 'numpy==2.5.3'
|
|
183
|
+
.benchmark-base/bin/python scripts/benchmark.py --output baseline.json --repeats 51 --pin-cpus 4
|
|
184
|
+
.benchmark-candidate/bin/python scripts/benchmark.py --output candidate.json --repeats 51 --pin-cpus 4
|
|
185
|
+
python scripts/compare_benchmarks.py baseline.json candidate.json --output comparison.md --report-only
|
|
186
|
+
cat comparison.md >> "$GITHUB_STEP_SUMMARY"
|
|
187
|
+
- uses: actions/upload-artifact@v7
|
|
188
|
+
if: always()
|
|
189
|
+
with:
|
|
190
|
+
name: benchmark
|
|
191
|
+
path: |
|
|
192
|
+
baseline.json
|
|
193
|
+
candidate.json
|
|
194
|
+
comparison.md
|
|
195
|
+
|
|
196
|
+
release:
|
|
197
|
+
name: Publish tested wheels
|
|
198
|
+
if: startsWith(github.ref, 'refs/tags/')
|
|
199
|
+
# native-plugins validates repository files with third-party CLIs fetched
|
|
200
|
+
# from npm at run time; it is a required PR check but must not be able to
|
|
201
|
+
# block wheel publication when npm or those CLI versions are unavailable.
|
|
202
|
+
needs: [wheels, compatibility, source]
|
|
203
|
+
runs-on: ubuntu-24.04
|
|
204
|
+
steps:
|
|
205
|
+
- uses: actions/download-artifact@v7
|
|
206
|
+
with:
|
|
207
|
+
pattern: wheels-*
|
|
208
|
+
merge-multiple: true
|
|
209
|
+
path: dist
|
|
210
|
+
- uses: actions/download-artifact@v7
|
|
211
|
+
with:
|
|
212
|
+
name: sdist
|
|
213
|
+
path: dist
|
|
214
|
+
- uses: PyO3/maturin-action@v1.46.0
|
|
215
|
+
env:
|
|
216
|
+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
|
|
217
|
+
with:
|
|
218
|
+
command: upload
|
|
219
|
+
args: --non-interactive dist/*
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Generated by Cargo
|
|
2
|
+
# will have compiled files and executables
|
|
3
|
+
debug/
|
|
4
|
+
target/
|
|
5
|
+
|
|
6
|
+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
|
7
|
+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
|
8
|
+
/talib/Cargo.lock
|
|
9
|
+
/talib-sys/Cargo.lock
|
|
10
|
+
|
|
11
|
+
# These are backup files generated by rustfmt
|
|
12
|
+
**/*.rs.bk
|
|
13
|
+
|
|
14
|
+
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
15
|
+
*.pdb
|
|
16
|
+
dependencies
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# Byte-compiled / optimized / DLL files
|
|
20
|
+
__pycache__/
|
|
21
|
+
*.py[cod]
|
|
22
|
+
*$py.class
|
|
23
|
+
|
|
24
|
+
# C extensions
|
|
25
|
+
*.so
|
|
26
|
+
|
|
27
|
+
# Distribution / packaging
|
|
28
|
+
.Python
|
|
29
|
+
build/
|
|
30
|
+
develop-eggs/
|
|
31
|
+
dist/
|
|
32
|
+
downloads/
|
|
33
|
+
eggs/
|
|
34
|
+
.eggs/
|
|
35
|
+
lib/
|
|
36
|
+
lib64/
|
|
37
|
+
parts/
|
|
38
|
+
sdist/
|
|
39
|
+
var/
|
|
40
|
+
wheels/
|
|
41
|
+
share/python-wheels/
|
|
42
|
+
*.egg-info/
|
|
43
|
+
.installed.cfg
|
|
44
|
+
*.egg
|
|
45
|
+
MANIFEST
|
|
46
|
+
|
|
47
|
+
# PyInstaller
|
|
48
|
+
# Usually these files are written by a python script from a template
|
|
49
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
50
|
+
*.manifest
|
|
51
|
+
*.spec
|
|
52
|
+
|
|
53
|
+
# Installer logs
|
|
54
|
+
pip-log.txt
|
|
55
|
+
pip-delete-this-directory.txt
|
|
56
|
+
|
|
57
|
+
# Unit test / coverage reports
|
|
58
|
+
htmlcov/
|
|
59
|
+
.tox/
|
|
60
|
+
.nox/
|
|
61
|
+
.coverage
|
|
62
|
+
.coverage.*
|
|
63
|
+
.cache
|
|
64
|
+
nosetests.xml
|
|
65
|
+
coverage.xml
|
|
66
|
+
*.cover
|
|
67
|
+
*.py,cover
|
|
68
|
+
.hypothesis/
|
|
69
|
+
.pytest_cache/
|
|
70
|
+
cover/
|
|
71
|
+
|
|
72
|
+
# Translations
|
|
73
|
+
*.mo
|
|
74
|
+
*.pot
|
|
75
|
+
|
|
76
|
+
# Django stuff:
|
|
77
|
+
*.log
|
|
78
|
+
local_settings.py
|
|
79
|
+
db.sqlite3
|
|
80
|
+
db.sqlite3-journal
|
|
81
|
+
|
|
82
|
+
# Flask stuff:
|
|
83
|
+
instance/
|
|
84
|
+
.webassets-cache
|
|
85
|
+
|
|
86
|
+
# Scrapy stuff:
|
|
87
|
+
.scrapy
|
|
88
|
+
|
|
89
|
+
# Sphinx documentation
|
|
90
|
+
docs/_build/
|
|
91
|
+
|
|
92
|
+
# PyBuilder
|
|
93
|
+
.pybuilder/
|
|
94
|
+
target/
|
|
95
|
+
|
|
96
|
+
# Jupyter Notebook
|
|
97
|
+
.ipynb_checkpoints
|
|
98
|
+
|
|
99
|
+
# IPython
|
|
100
|
+
profile_default/
|
|
101
|
+
ipython_config.py
|
|
102
|
+
|
|
103
|
+
# pyenv
|
|
104
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
105
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
106
|
+
# .python-version
|
|
107
|
+
|
|
108
|
+
# pipenv
|
|
109
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
110
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
111
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
112
|
+
# install all needed dependencies.
|
|
113
|
+
#Pipfile.lock
|
|
114
|
+
|
|
115
|
+
# poetry
|
|
116
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
117
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
118
|
+
# commonly ignored for libraries.
|
|
119
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
120
|
+
#poetry.lock
|
|
121
|
+
|
|
122
|
+
# pdm
|
|
123
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
124
|
+
#pdm.lock
|
|
125
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
126
|
+
# in version control.
|
|
127
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
128
|
+
.pdm.toml
|
|
129
|
+
|
|
130
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
131
|
+
__pypackages__/
|
|
132
|
+
|
|
133
|
+
# Celery stuff
|
|
134
|
+
celerybeat-schedule
|
|
135
|
+
celerybeat.pid
|
|
136
|
+
|
|
137
|
+
# SageMath parsed files
|
|
138
|
+
*.sage.py
|
|
139
|
+
|
|
140
|
+
# Environments
|
|
141
|
+
.env
|
|
142
|
+
.venv
|
|
143
|
+
env/
|
|
144
|
+
venv/
|
|
145
|
+
ENV/
|
|
146
|
+
env.bak/
|
|
147
|
+
venv.bak/
|
|
148
|
+
|
|
149
|
+
# Spyder project settings
|
|
150
|
+
.spyderproject
|
|
151
|
+
.spyproject
|
|
152
|
+
|
|
153
|
+
# Rope project settings
|
|
154
|
+
.ropeproject
|
|
155
|
+
|
|
156
|
+
# mkdocs documentation
|
|
157
|
+
/site
|
|
158
|
+
|
|
159
|
+
# mypy
|
|
160
|
+
.mypy_cache/
|
|
161
|
+
.dmypy.json
|
|
162
|
+
dmypy.json
|
|
163
|
+
|
|
164
|
+
# Pyre type checker
|
|
165
|
+
.pyre/
|
|
166
|
+
|
|
167
|
+
# pytype static type analyzer
|
|
168
|
+
.pytype/
|
|
169
|
+
|
|
170
|
+
# Cython debug symbols
|
|
171
|
+
cython_debug/
|
|
172
|
+
|
|
173
|
+
# pytest benchmark
|
|
174
|
+
.benchmarks
|
|
175
|
+
.wheel-test/
|
|
176
|
+
.skill-test/
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"CDL": {
|
|
3
|
+
"prefix": "CDL",
|
|
4
|
+
"body": [
|
|
5
|
+
"#[polars_expr(output_type=Int32)]",
|
|
6
|
+
"fn $1(inputs: &[Series]) -> PolarsResult<Series> {",
|
|
7
|
+
"let open = &mut inputs[0].to_float()?.rechunk();",
|
|
8
|
+
"let high = &mut inputs[1].to_float()?.rechunk();",
|
|
9
|
+
"let low = &mut inputs[2].to_float()?.rechunk();",
|
|
10
|
+
"let close = &mut inputs[3].to_float()?.rechunk();",
|
|
11
|
+
"let (open_ptr, _open) = get_series_f64_ptr(open)?;",
|
|
12
|
+
"let (high_ptr, _high) = get_series_f64_ptr(high)?;",
|
|
13
|
+
"let (low_ptr, _low) = get_series_f64_ptr(low)?;",
|
|
14
|
+
"let (close_ptr, _close) = get_series_f64_ptr(close)?;",
|
|
15
|
+
"let len = close.len();"
|
|
16
|
+
""
|
|
17
|
+
"let res = ta_$1(open_ptr, high_ptr, low_ptr, close_ptr, len);"
|
|
18
|
+
"match res {",
|
|
19
|
+
"Ok(out) => Ok(Int32Chunked::new("", out).into_series()),",
|
|
20
|
+
"Err(ret_code) => ta_code2err(ret_code),",
|
|
21
|
+
"}",
|
|
22
|
+
"}",
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
"CDLK": {
|
|
26
|
+
"prefix": "CDLK",
|
|
27
|
+
"body": [
|
|
28
|
+
"#[polars_expr(output_type=Int32)]",
|
|
29
|
+
"fn $1(inputs: &[Series], kwargs: CDLKwargs) -> PolarsResult<Series> {",
|
|
30
|
+
"let open = &mut inputs[0].to_float()?.rechunk();",
|
|
31
|
+
"let high = &mut inputs[1].to_float()?.rechunk();",
|
|
32
|
+
"let low = &mut inputs[2].to_float()?.rechunk();",
|
|
33
|
+
"let close = &mut inputs[3].to_float()?.rechunk();",
|
|
34
|
+
"let (open_ptr, _open) = get_series_f64_ptr(open)?;",
|
|
35
|
+
"let (high_ptr, _high) = get_series_f64_ptr(high)?;",
|
|
36
|
+
"let (low_ptr, _low) = get_series_f64_ptr(low)?;",
|
|
37
|
+
"let (close_ptr, _close) = get_series_f64_ptr(close)?;",
|
|
38
|
+
"let len = close.len();"
|
|
39
|
+
""
|
|
40
|
+
"let res = ta_$1(open_ptr, high_ptr, low_ptr, close_ptr, len, , &kwargs);"
|
|
41
|
+
"match res {",
|
|
42
|
+
"Ok(out) => Ok(Int32Chunked::new("", out).into_series()),",
|
|
43
|
+
"Err(ret_code) => ta_code2err(ret_code),",
|
|
44
|
+
"}",
|
|
45
|
+
"}",
|
|
46
|
+
],
|
|
47
|
+
}
|
|
48
|
+
}
|