|
2 | 2 |
|
3 | 3 | <p align="center"> |
4 | 4 | <a href="https://crates.io/crates/fastkmeans-rs"><img src="https://img.shields.io/crates/v/fastkmeans-rs.svg" alt="Crates.io"></a> |
5 | | - <a href="https://github.com/lightonai/fastkmeans-rs/actions/workflows/ci.yml"><img src="https://github.com/lightonai/fastkmeans-rs/actions/workflows/ci.yml/badge.svg" alt="CI"></a> |
6 | 5 | <a href="https://github.com/lightonai/fastkmeans-rs/blob/master/LICENSE"><img src="https://img.shields.io/crates/l/fastkmeans-rs.svg" alt="License"></a> |
7 | 6 | </p> |
8 | 7 |
|
@@ -227,6 +226,50 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { |
227 | 226 |
|
228 | 227 | <br> |
229 | 228 |
|
| 229 | +## Contributing |
| 230 | + |
| 231 | +### Setup |
| 232 | + |
| 233 | +1. Clone the repository: |
| 234 | + |
| 235 | +```bash |
| 236 | +git clone https://github.com/lightonai/fastkmeans-rs.git |
| 237 | +cd fastkmeans-rs |
| 238 | +``` |
| 239 | + |
| 240 | +2. Install the git hooks: |
| 241 | + |
| 242 | +```bash |
| 243 | +make install-hooks |
| 244 | +``` |
| 245 | + |
| 246 | +### Development Commands |
| 247 | + |
| 248 | +| Command | Description | |
| 249 | +| ------------------------ | ------------------------------------------------ | |
| 250 | +| `make build` | Build the project in debug mode | |
| 251 | +| `make release` | Build in release mode | |
| 252 | +| `make test` | Run all tests | |
| 253 | +| `make lint` | Run clippy and format checks | |
| 254 | +| `make fmt` | Format code | |
| 255 | +| `make doc` | Build documentation | |
| 256 | +| `make bench` | Run benchmarks | |
| 257 | +| `make example` | Run the basic example | |
| 258 | +| `make ci` | Run all CI checks locally | |
| 259 | +| `make compare-reference` | Compare output with Python fastkmeans (requires [uv](https://docs.astral.sh/uv/)) | |
| 260 | + |
| 261 | +### Running CI Locally |
| 262 | + |
| 263 | +Before submitting a PR, run all checks locally: |
| 264 | + |
| 265 | +```bash |
| 266 | +make ci |
| 267 | +``` |
| 268 | + |
| 269 | +This runs formatting checks, clippy, tests, documentation build, and benchmark compilation. |
| 270 | + |
| 271 | +<br> |
| 272 | + |
230 | 273 | ## Acknowledgements |
231 | 274 |
|
232 | 275 | This crate is a Rust port of [FastKMeans](https://github.com/AnswerDotAI/fastkmeans) by Answer.AI. All credit for the algorithm design and optimization strategies goes to the original authors. |
|
0 commit comments