Skip to content

Commit 3f9d349

Browse files
authored
Merge pull request #1 from quantbai/dev
release: v0.2.0
2 parents defacc9 + 362722a commit 3f9d349

31 files changed

Lines changed: 2414 additions & 350 deletions

.github/pull_request_template.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Summary
2+
<!-- 1-3 sentences describing the change -->
3+
4+
## Change Type
5+
- [ ] Bug fix (corrects incorrect behavior)
6+
- [ ] New feature (new operator or functionality)
7+
- [ ] Refactor (no behavior change)
8+
- [ ] Numerical change (alters factor computation results) [BREAKING]
9+
10+
## Numerical Impact
11+
<!-- If this changes numerical output, provide before/after factor statistics -->
12+
<!-- If no numerical impact, write "No numerical impact" -->
13+
14+
## Testing
15+
- [ ] Added or updated tests
16+
- [ ] All tests pass (`pytest tests/ -v`)
17+
- [ ] Lint passes (`ruff check elvers/`)

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main, dev]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- run: pip install -e ".[dev]"
21+
- run: ruff check elvers/
22+
- run: pytest tests/ -v

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release and Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: ["3.10", "3.11", "3.12", "3.13"]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- run: pip install -e ".[dev]"
20+
- run: ruff check elvers/
21+
- run: pytest tests/ -v
22+
23+
publish:
24+
needs: test
25+
runs-on: ubuntu-latest
26+
permissions:
27+
id-token: write
28+
contents: write
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.12"
35+
36+
- name: Install build tools
37+
run: pip install build
38+
39+
- name: Build package
40+
run: python -m build
41+
42+
- name: Publish to PyPI
43+
uses: pypa/gh-action-pypi-publish@release/v1
44+
45+
- name: Create GitHub Release
46+
uses: softprops/action-gh-release@v2
47+
with:
48+
generate_release_notes: true
49+
files: dist/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ venv/
2727
*.swp
2828
*.swo
2929
.DS_Store
30+
.claude/

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.4.0
4+
hooks:
5+
- id: ruff
6+
args: [--fix]
7+
- id: ruff-format
8+
- repo: local
9+
hooks:
10+
- id: pytest-check
11+
name: pytest
12+
entry: pytest tests/ -x -q
13+
language: system
14+
pass_filenames: false
15+
always_run: true

CHANGELOG.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
Format follows [Keep a Changelog](https://keepachangelog.com/).
6+
Numerical changes are marked with [NUMERICAL].
7+
8+
## [Unreleased]
9+
10+
## [0.2.0] - 2026-03-23
11+
12+
### Added
13+
- CLAUDE.md development standards (12 sections covering full workflow)
14+
- CI pipeline (GitHub Actions, pytest across Python 3.10-3.13)
15+
- Automated release pipeline (tag-triggered PyPI publish + GitHub Release)
16+
- Pre-commit hooks (ruff lint + format, pytest)
17+
- PR template with numerical impact checklist
18+
- Dev dependencies (pytest, ruff, pre-commit)
19+
- `elvers/ops/_dev.py` for experimental operators
20+
- `elvers/ops/_validation.py` input validation helpers
21+
- `load()` now accepts `interval` parameter for sub-daily data (e.g., "1h", "5m")
22+
- Factor constructor validates required columns [timestamp, symbol, factor]
23+
- Tests for `divide()`, `reverse()`, `ts_product` (negative/zero), `ts_regression` (lag>0)
24+
25+
### Fixed
26+
- [NUMERICAL] `ts_product`: silently returned null for negative inputs; now correctly handles negative values via sign-magnitude decomposition
27+
- [NUMERICAL] `ts_covariance`: used ddof=0 (population) inconsistent with `ts_corr` (ddof=1); aligned to ddof=1 (sample)
28+
- [NUMERICAL] `divide()`: no zero-denominator protection; now returns null where abs(divisor) < 1e-10
29+
- [NUMERICAL] `inverse()`: no zero protection; now returns null where abs(x) < 1e-10
30+
- `ts_regression` rettype=7 (MSE): implicit Inf-to-null on window=2; now has explicit guard
31+
- `ts_count_nans`: used min_samples=1 unlike all other ts_* operators; aligned to min_samples=window
32+
- `_balance()`: hardcoded daily frequency; now accepts interval parameter
33+
34+
### Changed
35+
- DEV operators (hump, ts_arg_max, ts_arg_min) moved from public API to `_dev.py`
36+
- Factor class now explicitly declares `__hash__ = None`
37+
- Ruff auto-formatted all source files (import sorting, Union -> X | Y syntax)

0 commit comments

Comments
 (0)