centaur_technical_indicators 1.2.1__tar.gz → 1.2.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.
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/.github/pull_request_template.md +0 -10
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/AGENTS.md +3 -7
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/CHANGELOG.md +17 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/Cargo.lock +4 -4
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/Cargo.toml +2 -2
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/PKG-INFO +1 -1
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/ai-policy.yaml +0 -2
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/docs/REPO_MAP.md +0 -2
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_momentum_indicators.py +24 -6
- centaur_technical_indicators-1.2.1/.github/copilot-instructions.md +0 -185
- centaur_technical_indicators-1.2.1/AI_FRIENDLY_ROADMAP.md +0 -90
- centaur_technical_indicators-1.2.1/docs/AI_ONBOARDING.md +0 -64
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/.github/CODEOWNERS +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/.github/workflows/CI.yml +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/.github/workflows/python-package.yml +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/.gitignore +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/CODE_OF_CONDUCT.md +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/CONTRIBUTING.md +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/LICENSE-MIT +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/README.md +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/SECURITY.md +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/assets/pytechnicalindicators_banner.png +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/pyproject.toml +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/requirements.txt +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/candle_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/chart_trends.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/correlation_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/lib.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/momentum_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/moving_average.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/other_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/strength_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/trend_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/volatility_indicators.rs +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/test_requirements.txt +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_candle_indicators.py +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_chart_trends.py +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_correlation_indicators.py +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_moving_average.py +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_other_indicators.py +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_strength_indicators.py +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_trend_indicators.py +0 -0
- {centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_volatility_indicators.py +0 -0
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
- What changed?
|
|
3
3
|
- Why was this change needed?
|
|
4
4
|
|
|
5
|
-
## Scope
|
|
6
|
-
- Files/modules touched:
|
|
7
|
-
- Intentionally not changed:
|
|
8
|
-
|
|
9
5
|
## Compatibility
|
|
10
6
|
- User-facing Python API impact:
|
|
11
7
|
- Migration notes (if any):
|
|
@@ -20,9 +16,3 @@ Command output summary:
|
|
|
20
16
|
## Changelog
|
|
21
17
|
- [ ] `CHANGELOG.md` updated for user-facing changes
|
|
22
18
|
- Entry summary:
|
|
23
|
-
|
|
24
|
-
## Manual Verification
|
|
25
|
-
- What was manually verified?
|
|
26
|
-
|
|
27
|
-
## AI Assistance Disclosure
|
|
28
|
-
- Was AI used? If yes, summarize what AI changed and what you verified manually.
|
|
@@ -10,9 +10,6 @@ Guidance for coding agents working in this repository.
|
|
|
10
10
|
- `tests/` → Python-facing smoke/behavior tests for bindings
|
|
11
11
|
|
|
12
12
|
## Docs to review before coding
|
|
13
|
-
- `docs/AI_ONBOARDING.md`
|
|
14
|
-
- `.github/copilot-instructions.md`
|
|
15
|
-
- `AI_FRIENDLY_ROADMAP.md`
|
|
16
13
|
- `docs/REPO_MAP.md`
|
|
17
14
|
- `CONTRIBUTING.md`
|
|
18
15
|
|
|
@@ -95,10 +92,9 @@ Run these before opening a PR:
|
|
|
95
92
|
Use this structure in PR descriptions/comments:
|
|
96
93
|
|
|
97
94
|
1. `Summary`: what changed and why.
|
|
98
|
-
2. `
|
|
99
|
-
3. `
|
|
100
|
-
4. `
|
|
101
|
-
5. `Changelog`: exact `CHANGELOG.md` entry added/updated.
|
|
95
|
+
2. `Compatibility`: any user-facing behavior/API impact.
|
|
96
|
+
3. `Validation`: results summary for `maturin develop`, `pytest`, and `cargo fmt`.
|
|
97
|
+
4. `Changelog`: exact `CHANGELOG.md` entry added/updated.
|
|
102
98
|
|
|
103
99
|
## Repository expectations
|
|
104
100
|
- This is a public Python/Rust library. Prioritize correctness, determinism, and backward compatibility.
|
|
@@ -6,6 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
## [1.2.2] - 2026-04-04
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
- Inherited fix for `relative_strength_index` (single and bulk) producing incorrect values via upstream crate update. The internal `previous_gains_loss` helper was only collecting non-zero gains/losses, discarding zero entries and causing misaligned averages.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- Updated `centaur_technical_indicators` Rust crate dependency from `1.2.1` to `1.2.2`
|
|
18
|
+
|
|
19
|
+
### Removed
|
|
20
|
+
- Removed `AI_FRIENDLY_ROADMAP.md`, `docs/AI_ONBOARDING.md`, and `.github/copilot-instructions.md` — redundant with `AGENTS.md`
|
|
21
|
+
- Removed dangling references to removed files from `AGENTS.md`, `docs/REPO_MAP.md`, and `ai-policy.yaml`
|
|
22
|
+
- Simplified PR template from 7 sections to 4 (`Summary`, `Compatibility`, `Validation`, `Changelog`)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
9
26
|
## [1.2.1] - 2026-03-01
|
|
10
27
|
|
|
11
28
|
### Changed
|
|
@@ -10,17 +10,17 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
|
|
|
10
10
|
|
|
11
11
|
[[package]]
|
|
12
12
|
name = "centaur_technical_indicators"
|
|
13
|
-
version = "1.2.
|
|
13
|
+
version = "1.2.2"
|
|
14
14
|
dependencies = [
|
|
15
|
-
"centaur_technical_indicators 1.2.
|
|
15
|
+
"centaur_technical_indicators 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
|
16
16
|
"pyo3",
|
|
17
17
|
]
|
|
18
18
|
|
|
19
19
|
[[package]]
|
|
20
20
|
name = "centaur_technical_indicators"
|
|
21
|
-
version = "1.2.
|
|
21
|
+
version = "1.2.2"
|
|
22
22
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
23
|
-
checksum = "
|
|
23
|
+
checksum = "24ae4cb5750fab3c9d2ae9be158158df08bb4b052c6e5c398885be57e0590be9"
|
|
24
24
|
|
|
25
25
|
[[package]]
|
|
26
26
|
name = "heck"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "centaur_technical_indicators"
|
|
3
|
-
version = "1.2.
|
|
3
|
+
version = "1.2.2"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
|
|
@@ -11,4 +11,4 @@ crate-type = ["cdylib"]
|
|
|
11
11
|
|
|
12
12
|
[dependencies]
|
|
13
13
|
pyo3 = "0.25.0"
|
|
14
|
-
centaur_technical_indicators = "1.2.
|
|
14
|
+
centaur_technical_indicators = "1.2.2"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: centaur_technical_indicators
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
4
4
|
Classifier: Development Status :: 5 - Production/Stable
|
|
5
5
|
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
6
6
|
Classifier: Topic :: Software Development :: Libraries
|
|
@@ -39,7 +39,6 @@ coding_rules:
|
|
|
39
39
|
pr_report:
|
|
40
40
|
required_sections:
|
|
41
41
|
- Summary
|
|
42
|
-
- Scope
|
|
43
42
|
- Compatibility
|
|
44
43
|
- Validation
|
|
45
44
|
- Changelog
|
|
@@ -48,5 +47,4 @@ notes:
|
|
|
48
47
|
source_of_truth:
|
|
49
48
|
- AGENTS.md
|
|
50
49
|
- CONTRIBUTING.md
|
|
51
|
-
- AI_FRIENDLY_ROADMAP.md
|
|
52
50
|
purpose: Minimal machine-readable policy for AI agents and automation.
|
|
@@ -12,8 +12,6 @@ Quick orientation for contributors and coding agents working in `CentaurTechnica
|
|
|
12
12
|
- `pyproject.toml`: Python package metadata and maturin build settings.
|
|
13
13
|
- `CHANGELOG.md`: required entry point for every user-facing change.
|
|
14
14
|
- `AGENTS.md`: agent operating rules and PR/reporting expectations.
|
|
15
|
-
- `docs/AI_ONBOARDING.md`: canonical start-here checklist for coding agents.
|
|
16
|
-
- `AI_FRIENDLY_ROADMAP.md`: contributor-workflow and feature roadmap.
|
|
17
15
|
- `CONTRIBUTING.md`: contributor expectations and required validation gates.
|
|
18
16
|
|
|
19
17
|
## Source module map (`src/`)
|
|
@@ -30,23 +30,41 @@ volume = [1000.0, 1500.0, 1200.0, 900.0, 1300.0]
|
|
|
30
30
|
|
|
31
31
|
def test_single_relative_strength_index():
|
|
32
32
|
assert momentum_indicators.single.relative_strength_index(prices, "simple") == 42.857142857142854
|
|
33
|
-
assert momentum_indicators.single.relative_strength_index(prices, "smoothed") ==
|
|
34
|
-
assert momentum_indicators.single.relative_strength_index(prices, "exponential") ==
|
|
35
|
-
assert momentum_indicators.single.relative_strength_index(prices, "median") ==
|
|
36
|
-
assert momentum_indicators.single.relative_strength_index(prices, "mode") ==
|
|
33
|
+
assert momentum_indicators.single.relative_strength_index(prices, "smoothed") == 28.662420382165607
|
|
34
|
+
assert momentum_indicators.single.relative_strength_index(prices, "exponential") == 19.839679358717433
|
|
35
|
+
assert momentum_indicators.single.relative_strength_index(prices, "median") == 33.33333333333333
|
|
36
|
+
assert momentum_indicators.single.relative_strength_index(prices, "mode") == 0.0
|
|
37
37
|
with pytest.raises(ValueError):
|
|
38
38
|
momentum_indicators.single.relative_strength_index(prices, "")
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
def test_bulk_relative_strength_index():
|
|
42
42
|
assert momentum_indicators.bulk.relative_strength_index(prices, "simple", 3) == [100.0, 33.33333333333333, 0.0]
|
|
43
|
-
assert momentum_indicators.bulk.relative_strength_index(prices, "smoothed", 3) == [100.0,
|
|
44
|
-
assert momentum_indicators.bulk.relative_strength_index(prices, "exponential", 3) == [100.0,
|
|
43
|
+
assert momentum_indicators.bulk.relative_strength_index(prices, "smoothed", 3) == [100.0, 20.0, 0.0]
|
|
44
|
+
assert momentum_indicators.bulk.relative_strength_index(prices, "exponential", 3) == [100.0, 14.285714285714292, 0.0]
|
|
45
45
|
assert momentum_indicators.bulk.relative_strength_index(prices, "median", 3) == [100.0, 33.33333333333333, 0.0]
|
|
46
46
|
assert momentum_indicators.bulk.relative_strength_index(prices, "mode", 3) == [100.0, 33.33333333333333, 0.0]
|
|
47
47
|
with pytest.raises(ValueError):
|
|
48
48
|
momentum_indicators.bulk.relative_strength_index(prices, "", 3)
|
|
49
49
|
|
|
50
|
+
flat_prices = [100.0, 100.0, 100.0, 102.0, 101.0]
|
|
51
|
+
|
|
52
|
+
def test_single_relative_strength_index_zero_change_regression():
|
|
53
|
+
"""Regression: zero-change periods must not be discarded from RSI calculation (upstream fix in v1.2.2)."""
|
|
54
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "simple") == 66.66666666666666
|
|
55
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "smoothed") == 60.0
|
|
56
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "exponential") == 54.54545454545455
|
|
57
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "median") == 0.0
|
|
58
|
+
assert momentum_indicators.single.relative_strength_index(flat_prices, "mode") == 0.0
|
|
59
|
+
|
|
60
|
+
def test_bulk_relative_strength_index_zero_change_regression():
|
|
61
|
+
"""Regression: zero-change periods must not be discarded from bulk RSI calculation (upstream fix in v1.2.2)."""
|
|
62
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "simple", 3) == [0.0, 100.0, 66.66666666666666]
|
|
63
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "smoothed", 3) == [0.0, 100.0, 50.0]
|
|
64
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "exponential", 3) == [0.0, 100.0, 40.0]
|
|
65
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "median", 3) == [0.0, 100.0, 66.66666666666666]
|
|
66
|
+
assert momentum_indicators.bulk.relative_strength_index(flat_prices, "mode", 3) == [0.0, 100.0, 66.66666666666666]
|
|
67
|
+
|
|
50
68
|
def test_single_stochastic_oscillator():
|
|
51
69
|
assert momentum_indicators.single.stochastic_oscillator(prices) == 0.0
|
|
52
70
|
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
# Copilot Instructions for Centaur Technical Indicators
|
|
2
|
-
|
|
3
|
-
## Repository Overview
|
|
4
|
-
|
|
5
|
-
**Centaur Technical Indicators** is a production-ready Python library providing 60+ technical indicators for financial analysis, built on a high-performance Rust backend. The project uses PyO3 and maturin to create Python bindings for the underlying Rust implementation.
|
|
6
|
-
|
|
7
|
-
**Key Stats:**
|
|
8
|
-
- **Languages:** Rust (backend), Python (bindings/tests)
|
|
9
|
-
- **Build System:** maturin (Rust-Python integration)
|
|
10
|
-
- **Python Support:** 3.10+ (tested through 3.14)
|
|
11
|
-
- **Test Suite:** 107 tests, ~0.31s runtime
|
|
12
|
-
- **License:** MIT
|
|
13
|
-
|
|
14
|
-
## Build Instructions & Validated Commands
|
|
15
|
-
|
|
16
|
-
### Bootstrap & Environment Setup (Required)
|
|
17
|
-
**Always create a virtual environment before building:**
|
|
18
|
-
```bash
|
|
19
|
-
python -m venv .venv
|
|
20
|
-
source .venv/bin/activate
|
|
21
|
-
python -m pip install --upgrade pip
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Install Dependencies (Required)
|
|
25
|
-
```bash
|
|
26
|
-
pip install -r test_requirements.txt
|
|
27
|
-
```
|
|
28
|
-
**Contents:** maturin==1.9.1, pytest==8.4.1, and supporting packages
|
|
29
|
-
|
|
30
|
-
### Build the Project (Required)
|
|
31
|
-
```bash
|
|
32
|
-
maturin develop
|
|
33
|
-
```
|
|
34
|
-
- **Duration:** ~14 seconds for full compilation
|
|
35
|
-
- **Function:** Compiles Rust code and installs Python package in editable mode
|
|
36
|
-
- **Output:** Installs `centaur_technical_indicators` package locally
|
|
37
|
-
|
|
38
|
-
### Run Tests (Validation)
|
|
39
|
-
```bash
|
|
40
|
-
python -m pytest
|
|
41
|
-
```
|
|
42
|
-
- **Expected:** 107 tests pass in ~0.31s
|
|
43
|
-
- **Coverage:** All indicator modules with bulk/single function variants
|
|
44
|
-
|
|
45
|
-
### Format Code (Optional)
|
|
46
|
-
```bash
|
|
47
|
-
cargo fmt --check # Check Rust formatting
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Environment Versions (Reference)
|
|
51
|
-
- **Python:** 3.12.3+
|
|
52
|
-
- **Rust:** 1.89.0+
|
|
53
|
-
- **maturin:** 1.9.1
|
|
54
|
-
|
|
55
|
-
## Project Layout & Architecture
|
|
56
|
-
|
|
57
|
-
### Root Directory Structure
|
|
58
|
-
```
|
|
59
|
-
/
|
|
60
|
-
├── .github/ # Workflows, issue templates, CODEOWNERS
|
|
61
|
-
├── src/ # Rust source modules
|
|
62
|
-
├── tests/ # Python test files (mirror src/ structure)
|
|
63
|
-
├── assets/ # Documentation assets, banner images
|
|
64
|
-
├── pyproject.toml # Python project configuration, maturin settings
|
|
65
|
-
├── Cargo.toml # Rust project configuration, dependencies
|
|
66
|
-
├── requirements.txt # Runtime dependencies (minimal)
|
|
67
|
-
├── test_requirements.txt # Development/test dependencies
|
|
68
|
-
└── README.md # Comprehensive project documentation
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
### Source Code Architecture (`src/`)
|
|
72
|
-
**Modular Design by Analysis Area:**
|
|
73
|
-
- `lib.rs` - Main module, PyO3 bindings setup, type definitions
|
|
74
|
-
- `candle_indicators.rs` - Ichimoku, Bollinger Bands, Keltner, Supertrend
|
|
75
|
-
- `momentum_indicators.rs` - RSI, MACD, CCI, Williams %R, Stochastic
|
|
76
|
-
- `moving_average.rs` - Simple, Exponential, Smoothed, McGinley Dynamic
|
|
77
|
-
- `standard_indicators.rs` - Basic indicators, moving averages
|
|
78
|
-
- `trend_indicators.rs` - Aroon, Parabolic SAR, DM, TSI
|
|
79
|
-
- `volatility_indicators.rs` - Ulcer Index, Volatility System
|
|
80
|
-
- `strength_indicators.rs` - A/D, PVI, NVI, RVI
|
|
81
|
-
- `chart_trends.rs` - Trend analysis, peak/valley detection
|
|
82
|
-
- `correlation_indicators.rs` - Asset price correlation
|
|
83
|
-
- `other_indicators.rs` - ROI, True Range, ATR
|
|
84
|
-
|
|
85
|
-
### API Design Patterns
|
|
86
|
-
- **Dual Function Variants:** Each indicator has `bulk` (returns list) and `single` (returns scalar) versions
|
|
87
|
-
- **Type System:** Custom enums (`PyConstantModelType`, `DeviationModel`, `MovingAverageType`) for configuration
|
|
88
|
-
- **Error Handling:** Uses `PyValueError` for invalid inputs with descriptive messages
|
|
89
|
-
|
|
90
|
-
### Test Structure (`tests/`)
|
|
91
|
-
- **Naming Convention:** `test_<module_name>.py` mirrors `src/<module_name>.rs`
|
|
92
|
-
- **Purpose:** Binding verification, not exhaustive testing (core logic tested in RustTI)
|
|
93
|
-
- **Pattern:** Basic smoke tests to ensure Python-Rust interface works
|
|
94
|
-
|
|
95
|
-
## CI/CD & Validation Pipelines
|
|
96
|
-
|
|
97
|
-
### GitHub Workflows
|
|
98
|
-
1. **`python-package.yml`** - Pull request validation
|
|
99
|
-
- Tests across Python 3.10-3.14 on Ubuntu
|
|
100
|
-
- Steps: checkout → setup Python → install deps → maturin develop → pytest
|
|
101
|
-
|
|
102
|
-
2. **`CI.yml`** - Release pipeline (maturin-generated)
|
|
103
|
-
- Multi-platform wheel building (Linux, Windows, macOS)
|
|
104
|
-
- Multiple architectures (x86_64, ARM, etc.)
|
|
105
|
-
- Automatic PyPI publication on tags
|
|
106
|
-
|
|
107
|
-
### Pre-commit Validation Steps
|
|
108
|
-
```bash
|
|
109
|
-
# Recommended validation sequence:
|
|
110
|
-
source .venv/bin/activate
|
|
111
|
-
pip install -r test_requirements.txt
|
|
112
|
-
maturin develop
|
|
113
|
-
python -m pytest
|
|
114
|
-
cargo fmt --check # Optional: check Rust formatting
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Development Guidelines
|
|
118
|
-
|
|
119
|
-
### Making Code Changes
|
|
120
|
-
1. **Rust Changes:** Edit files in `src/`, then run `maturin develop` to rebuild
|
|
121
|
-
2. **Python Tests:** Add corresponding tests in `tests/` following existing patterns
|
|
122
|
-
3. **API Consistency:** Maintain `bulk`/`single` function variants for new indicators
|
|
123
|
-
4. **Type Safety:** Use existing enum types or add new ones following the pattern in `lib.rs`
|
|
124
|
-
|
|
125
|
-
### Performance Considerations
|
|
126
|
-
- **Rust Backend:** Core calculations optimized for microsecond-level performance
|
|
127
|
-
- **Bulk vs Single:** Use `bulk` for time series, `single` for latest values
|
|
128
|
-
- **Memory:** Rust handles memory management; Python side is minimal overhead
|
|
129
|
-
|
|
130
|
-
### Dependencies & Updates
|
|
131
|
-
- **Rust Dependencies:** Managed in `Cargo.toml` (pyo3, rust_ti)
|
|
132
|
-
- **Python Dependencies:** Keep `test_requirements.txt` minimal
|
|
133
|
-
- **Version Constraints:** Python 3.10+ required for modern features
|
|
134
|
-
|
|
135
|
-
## Common Workflows & Commands
|
|
136
|
-
|
|
137
|
-
### Complete Development Setup
|
|
138
|
-
```bash
|
|
139
|
-
git clone <repo>
|
|
140
|
-
cd CentaurTechnicalIndicators-Python
|
|
141
|
-
python -m venv .venv
|
|
142
|
-
source .venv/bin/activate
|
|
143
|
-
pip install -r test_requirements.txt
|
|
144
|
-
maturin develop
|
|
145
|
-
python -m pytest
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
### Iterative Development
|
|
149
|
-
```bash
|
|
150
|
-
# After making Rust changes:
|
|
151
|
-
maturin develop # Rebuild and reinstall
|
|
152
|
-
python -m pytest # Verify no regressions
|
|
153
|
-
|
|
154
|
-
# After making Python test changes:
|
|
155
|
-
python -m pytest # Run updated tests
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Release Preparation
|
|
159
|
-
```bash
|
|
160
|
-
cargo fmt # Format Rust code
|
|
161
|
-
python -m pytest # Ensure all tests pass
|
|
162
|
-
# CI handles wheel building and PyPI publication
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
## Key Files & Configuration
|
|
166
|
-
|
|
167
|
-
### Build Configuration
|
|
168
|
-
- **`pyproject.toml`:** Python packaging, maturin settings, project metadata
|
|
169
|
-
- **`Cargo.toml`:** Rust compilation, dependencies (pyo3, rust_ti)
|
|
170
|
-
- **`.gitignore`:** Excludes `target/`, `.venv/`, `__pycache__/`, build artifacts
|
|
171
|
-
|
|
172
|
-
### Documentation Resources
|
|
173
|
-
- **`README.md`:** Complete user documentation, examples, API reference
|
|
174
|
-
- **`CONTRIBUTING.md`:** Contribution guidelines, new indicator process
|
|
175
|
-
- **Wiki:** Full API reference and usage examples
|
|
176
|
-
- **External:** Tutorials, benchmarks, and how-to guides in separate repos
|
|
177
|
-
|
|
178
|
-
## Trust These Instructions
|
|
179
|
-
|
|
180
|
-
These instructions are validated and complete. Only perform additional repository exploration if:
|
|
181
|
-
- The build process fails unexpectedly
|
|
182
|
-
- Dependencies have changed significantly
|
|
183
|
-
- New requirements are introduced in documentation
|
|
184
|
-
|
|
185
|
-
The provided build sequence works reliably and efficiently for the current codebase.
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# AI-Friendly Roadmap
|
|
2
|
-
|
|
3
|
-
This document is a practical map for contributors and coding agents working in `CentaurTechnicalIndicators-Python`.
|
|
4
|
-
|
|
5
|
-
## How to use this roadmap
|
|
6
|
-
|
|
7
|
-
- `Now`: high-confidence, near-term items that improve contributor and agent reliability.
|
|
8
|
-
- `Next`: medium-term items that build on completed `Now` work.
|
|
9
|
-
- `Later`: directional items that should not block current PRs.
|
|
10
|
-
- Each milestone includes acceptance criteria and non-goals to keep the implementation scope clear.
|
|
11
|
-
|
|
12
|
-
## Current API surface by module
|
|
13
|
-
|
|
14
|
-
This package exposes Python bindings for the following indicator modules from the upstream Rust crate, each with `single` and/or `bulk` submodules where applicable:
|
|
15
|
-
|
|
16
|
-
- `candle_indicators`: candle-derived indicators (bands/channels/envelopes and related tools).
|
|
17
|
-
- `chart_trends`: peak/valley and trend-structure analysis.
|
|
18
|
-
- `correlation_indicators`: pairwise/statistical relationship indicators.
|
|
19
|
-
- `momentum_indicators`: momentum and oscillator families.
|
|
20
|
-
- `moving_average`: core moving-average implementations.
|
|
21
|
-
- `other_indicators`: miscellaneous indicators.
|
|
22
|
-
- `strength_indicators`: strength/volume participation indicators.
|
|
23
|
-
- `trend_indicators`: trend direction/strength systems.
|
|
24
|
-
- `volatility_indicators`: volatility and range-expansion indicators.
|
|
25
|
-
|
|
26
|
-
Shared Python-side support:
|
|
27
|
-
|
|
28
|
-
- `lib.rs`: PyO3 module wiring, shared type enum definitions.
|
|
29
|
-
- `PyConstantModelType`, `DeviationModel`, `MovingAverageType`: shared enums passed as strings from Python.
|
|
30
|
-
|
|
31
|
-
## Binding design conventions
|
|
32
|
-
|
|
33
|
-
1. **Preserve the bulk/single API pattern** — each indicator exposes a `bulk` (returns list) and `single` (returns scalar) variant.
|
|
34
|
-
2. **Accept enum arguments as strings** — all model/type parameters are accepted as Python strings and resolved in Rust with user-friendly error messages on invalid input.
|
|
35
|
-
3. **Use `PyValueError`** for all user-facing error surfaces at the Python boundary.
|
|
36
|
-
4. **Do not silently change indicator semantics** — bindings delegate all calculation logic to the upstream Rust crate.
|
|
37
|
-
|
|
38
|
-
## Testing/validation expectations
|
|
39
|
-
|
|
40
|
-
Before opening a PR, contributors should run and report:
|
|
41
|
-
|
|
42
|
-
1. `maturin develop` (bindings compile cleanly)
|
|
43
|
-
2. `python -m pytest` (all tests pass)
|
|
44
|
-
3. `cargo fmt --check` (no formatting diffs)
|
|
45
|
-
|
|
46
|
-
## Contributor workflow roadmap
|
|
47
|
-
|
|
48
|
-
This section tracks changes that make the repository easier for both human contributors and coding agents to work in safely.
|
|
49
|
-
|
|
50
|
-
### Now
|
|
51
|
-
|
|
52
|
-
1. **PR quality report standardization**
|
|
53
|
-
- Goal: all AI/human PRs present the same validation summary shape.
|
|
54
|
-
- Acceptance criteria:
|
|
55
|
-
- `AGENTS.md` defines a required PR summary format.
|
|
56
|
-
- PR descriptions consistently include `Summary`, `Scope`, `Compatibility`, `Validation`, and `Changelog`.
|
|
57
|
-
- Non-goals:
|
|
58
|
-
- Enforcing via CI in this milestone.
|
|
59
|
-
2. **Repository orientation map**
|
|
60
|
-
- Goal: reduce onboarding/search time for contributors and agents.
|
|
61
|
-
- Acceptance criteria:
|
|
62
|
-
- `docs/REPO_MAP.md` exists with key directories, extension points, and "if changing X, also check Y" guidance.
|
|
63
|
-
- Non-goals:
|
|
64
|
-
- Exhaustive architecture documentation.
|
|
65
|
-
3. **Machine-readable contribution policy**
|
|
66
|
-
- Goal: enable deterministic checks by automation/bots.
|
|
67
|
-
- Acceptance criteria:
|
|
68
|
-
- `ai-policy.yaml` lists required checks and user-facing change obligations.
|
|
69
|
-
- Policy contents match `AGENTS.md`/`CONTRIBUTING.md`.
|
|
70
|
-
- Non-goals:
|
|
71
|
-
- Full custom policy engine implementation.
|
|
72
|
-
|
|
73
|
-
### Next
|
|
74
|
-
|
|
75
|
-
1. **CI guardrails for contribution policy**
|
|
76
|
-
- Goal: make contributor requirements executable rather than advisory.
|
|
77
|
-
- Acceptance criteria:
|
|
78
|
-
- CI checks for required validation commands.
|
|
79
|
-
- CI checks for `CHANGELOG.md` updates on user-facing changes.
|
|
80
|
-
- Non-goals:
|
|
81
|
-
- Blocking on benchmark jobs in the main CI pipeline.
|
|
82
|
-
|
|
83
|
-
### Later
|
|
84
|
-
|
|
85
|
-
1. **Agent bootstrap command**
|
|
86
|
-
- Goal: provide a one-command local setup and verification flow for new contributors/agents.
|
|
87
|
-
- Acceptance criteria:
|
|
88
|
-
- Script or task runner target that documents and runs core checks in order.
|
|
89
|
-
- Non-goals:
|
|
90
|
-
- Replacing existing contributor docs.
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
# AI Onboarding
|
|
2
|
-
|
|
3
|
-
Start here when an AI agent begins work in `CentaurTechnicalIndicators-Python`.
|
|
4
|
-
|
|
5
|
-
## Goal
|
|
6
|
-
|
|
7
|
-
Provide one deterministic startup flow so agents can orient quickly, avoid policy misses, and make minimal, safe changes without altering public APIs unintentionally.
|
|
8
|
-
|
|
9
|
-
## Startup Flow (in order)
|
|
10
|
-
|
|
11
|
-
1. Read repository rules:
|
|
12
|
-
- `AGENTS.md`
|
|
13
|
-
- `.github/copilot-instructions.md`
|
|
14
|
-
- `CONTRIBUTING.md`
|
|
15
|
-
2. Read project orientation:
|
|
16
|
-
- `docs/REPO_MAP.md`
|
|
17
|
-
- `AI_FRIENDLY_ROADMAP.md`
|
|
18
|
-
3. Use machine-readable policy source:
|
|
19
|
-
- `ai-policy.yaml` (machine-readable contribution policy)
|
|
20
|
-
4. Confirm affected modules in `src/` and keep scope focused.
|
|
21
|
-
|
|
22
|
-
## Non-Negotiable Rules
|
|
23
|
-
|
|
24
|
-
- Preserve the `bulk`/`single` API pattern for all indicator functions.
|
|
25
|
-
- Keep public API behavior stable unless explicitly asked to introduce a breaking change.
|
|
26
|
-
- Add/adjust tests in `tests/` to match any binding changes in `src/`.
|
|
27
|
-
- Add a `CHANGELOG.md` entry for each user-facing change.
|
|
28
|
-
- Always rebuild bindings after Rust source changes: `maturin develop`.
|
|
29
|
-
|
|
30
|
-
## Agent-Friendly Change Strategy
|
|
31
|
-
|
|
32
|
-
1. Identify the smallest module/file that can satisfy the task.
|
|
33
|
-
2. Prefer additive or internal-only edits over broad refactors.
|
|
34
|
-
3. If changing output semantics, update tests and document compatibility impact.
|
|
35
|
-
4. If touching public function signatures or enum strings, include clear compatibility notes.
|
|
36
|
-
|
|
37
|
-
## Required Local Validation Gates
|
|
38
|
-
|
|
39
|
-
Run from repository root (after activating the virtual environment):
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
pip install -r test_requirements.txt
|
|
43
|
-
maturin develop
|
|
44
|
-
python -m pytest
|
|
45
|
-
cargo fmt --check
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## PR/Report Output Format
|
|
49
|
-
|
|
50
|
-
Use this structure:
|
|
51
|
-
|
|
52
|
-
1. `Summary`
|
|
53
|
-
2. `Scope`
|
|
54
|
-
3. `Compatibility`
|
|
55
|
-
4. `Validation`
|
|
56
|
-
5. `Changelog`
|
|
57
|
-
|
|
58
|
-
## Quick Pointers
|
|
59
|
-
|
|
60
|
-
- Python module wiring and type enums: `src/lib.rs`
|
|
61
|
-
- Indicator binding implementations: `src/<module_name>.rs`
|
|
62
|
-
- Python-facing tests: `tests/test_<module_name>.py`
|
|
63
|
-
- Dependency versions: `Cargo.toml` (Rust), `test_requirements.txt` (Python)
|
|
64
|
-
- Package metadata: `pyproject.toml`
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/.github/CODEOWNERS
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/.github/workflows/CI.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/CODE_OF_CONDUCT.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/candle_indicators.rs
RENAMED
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/chart_trends.rs
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/momentum_indicators.rs
RENAMED
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/moving_average.rs
RENAMED
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/other_indicators.rs
RENAMED
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/strength_indicators.rs
RENAMED
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/src/trend_indicators.rs
RENAMED
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/test_requirements.txt
RENAMED
|
File without changes
|
|
File without changes
|
{centaur_technical_indicators-1.2.1 → centaur_technical_indicators-1.2.2}/tests/test_chart_trends.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|