Skip to content

Commit aa495b7

Browse files
author
min
committed
fix: fix demo comments
1 parent d0367ee commit aa495b7

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

AGENTS.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
- `src/cryptoservice/`: core package with async services, storage, and models grouped by domain (clients, services, storage, utils).
5+
- `tests/`: pytest suite mirroring package layout; async fixtures live in `tests/__init__.py`.
6+
- `docs/` and `mkdocs.yml`: MkDocs-driven documentation.
7+
- `scripts/`: automation helpers such as `prepare_release.py` for versioning and release branches.
8+
- `demo/` and `examples/`: runnable usage samples; keep them in sync with public APIs when adding features.
9+
10+
## Build, Test, and Development Commands
11+
- `python3 -m pip install -e .[dev-all]`: install project plus dev tools (via uv or pip).
12+
- `ruff format && ruff check`: format/lint code to repository standards.
13+
- `pytest -v --cov=src/cryptoservice`: run the async test suite with coverage details.
14+
- `python3 scripts/prepare_release.py <version> --auto --push`: create release branch, run tests, tag, and push once the tree is clean.
15+
16+
## Coding Style & Naming Conventions
17+
- Python ≥3.10 with async-first design; prefer `async/await` and type hints everywhere.
18+
- Follow Ruff defaults: 120-character lines, double quotes, spaces for indentation.
19+
- Keep modules small and feature-focused; filenames use snake_case, classes use PascalCase, constants uppercase.
20+
- Run `ruff check --fix` before committing to catch security and style issues early.
21+
22+
## Testing Guidelines
23+
- Tests rely on `pytest`, `pytest-asyncio`, and coverage; new code should include async tests mirroring service behavior.
24+
- Name test files `tests/test_*.py`; structure tests to reflect module boundaries (e.g., `services` tests in `tests/test_services.py`).
25+
- For regression coverage, add parametrized cases rather than duplicating fixtures; update expected artifacts in `data/` sparingly and document any large fixtures.
26+
27+
## Commit & Pull Request Guidelines
28+
- Use Conventional Commits (`feat`, `fix`, `docs`, `chore`, etc.); release commits are generated by `prepare_release.py`.
29+
- PRs should explain motivation, link issues, and list manual verification (tests run, docs updated). Include screenshots or logs when touching demos.
30+
- Keep PRs focused: refactors separate from feature work; update docs/examples alongside code changes.
31+
32+
## Security & Configuration Tips
33+
- Secrets live in `.env` (e.g., `BINANCE_API_KEY`, `BINANCE_API_SECRET`); never commit real credentials.
34+
- When adding integrations, document required environment variables in `docs/` and provide safe defaults for local runs.

CLAUDE.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This is a Python cryptocurrency data processing package called `cryptoservice` t
1111
- Historical data processing and analysis
1212
- Database storage with SQLite
1313

14-
The project is currently at version 1.10.0 and supports Python >=3.10,<3.13.
14+
The project is currently at version 1.11.1 and supports Python >=3.10,<3.13.
1515

1616
## Architecture
1717

@@ -178,3 +178,29 @@ The project organizes data in structured directories:
178178
- `data/exports/`: Exported numpy arrays organized by universe, timeframe, and data type
179179
- `data/categories/`: Symbol category CSV files with timestamps
180180
- Export format: `univ_{params}/1d/{metric_type}/YYYYMMDD.npy` and `.pkl` files for symbols
181+
182+
## Release Management
183+
184+
The project includes a custom release script for version management:
185+
```bash
186+
# Prepare a new release (updates version, changelog, tests, commits, tags)
187+
python3 scripts/prepare_release.py 1.12.0 --auto --push
188+
189+
# Options:
190+
# --auto: Full workflow (test, commit, tag)
191+
# --push: Push to remote repository
192+
# --skip-tests: Skip running tests
193+
# --skip-changelog: Skip changelog generation
194+
```
195+
196+
This script:
197+
- Updates version in `pyproject.toml` and `src/cryptoservice/__init__.py`
198+
- Generates changelog entries from commit history
199+
- Creates release branch, commits changes, and creates git tags
200+
- Optionally pushes to remote repository
201+
202+
# important-instruction-reminders
203+
Do what has been asked; nothing more, nothing less.
204+
NEVER create files unless they're absolutely necessary for achieving your goal.
205+
ALWAYS prefer editing an existing file to creating a new one.
206+
NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested by the User.

demo/define_universe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
T2_MONTHS = 1 # 1个月重平衡频率
2929
T3_MONTHS = 1 # 1个月最小合约存在时间
3030
# TOP_K = 160 # Top 160合约 (与 TOP_RATIO 二选一)
31-
TOP_RATIO = 0.1 # 选择Top 80%的合约
31+
TOP_RATIO = 0.1 # 选择Top 10%的合约
3232
DELAY_DAYS = 7 # 延迟7天
3333
QUOTE_ASSET = "USDT" # 只使用USDT永续合约
3434

0 commit comments

Comments
 (0)