diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e8ef0f9..365142c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -65,8 +65,8 @@ cargo clippy -- -D warnings ### Pull Requests -- Fork the repository and create a feature branch from `develop` -- **Rebase your branch** to the top of `develop` before submitting PR +- Fork the repository and create a short-lived feature branch from `main` (trunk-based development) +- **Rebase your branch** to the top of `main` before submitting PR - Use **semantic commit messages** (e.g., `feat:`, `fix:`, `docs:`, `refactor:`) - Add tests for new functionality - **Ensure all CI checks pass** before requesting review diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci.yml similarity index 93% rename from .github/workflows/ci-develop.yml rename to .github/workflows/ci.yml index 0dcef3c..578d35f 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,10 @@ -name: CI (develop) +name: CI on: pull_request: - branches: [develop] + branches: [main] push: - branches: [develop] + branches: [main] jobs: ci: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index f224106..e37f224 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -2,9 +2,9 @@ name: Coverage (llvm-cov → Codecov) on: pull_request: - branches: [develop] + branches: [main] push: - branches: [develop, main] + branches: [main] workflow_dispatch: jobs: diff --git a/README.md b/README.md index 7739796..eaad5df 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,8 @@ [![Dev Docs](https://docs.rs/fugue-ppl/badge.svg)](https://docs.rs/fugue-ppl) [![User Docs](https://img.shields.io/badge/guides-fugue.run-blue)](https://fugue.run) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![CI](https://github.com/alexnodeland/fugue/actions/workflows/ci-develop.yml/badge.svg)](https://github.com/alexnodeland/fugue/actions/workflows/ci-develop.yml) -[![codecov](https://codecov.io/gh/alexnodeland/fugue/branch/develop/graph/badge.svg?token=BDJ5OB6GOB)](https://codecov.io/gh/alexnodeland/fugue) +[![CI](https://github.com/alexnodeland/fugue/actions/workflows/ci.yml/badge.svg)](https://github.com/alexnodeland/fugue/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/alexnodeland/fugue/branch/main/graph/badge.svg?token=BDJ5OB6GOB)](https://codecov.io/gh/alexnodeland/fugue) [![Downloads](https://img.shields.io/crates/d/fugue-ppl?logo=rust)](https://crates.io/crates/fugue-ppl) [![Zotero](https://img.shields.io/badge/Zotero-Fugue-red?style=flat-square&logo=zotero&logoColor=CC2936)](https://www.zotero.org/groups/6138134/fugue/library) [![Discord](https://img.shields.io/discord/1412802057437712426?logo=discord&label=discord)](https://discord.gg/QAcF7Nwr) diff --git a/docs/src/home.md b/docs/src/home.md index b823aa5..3b49154 100644 --- a/docs/src/home.md +++ b/docs/src/home.md @@ -13,8 +13,8 @@ [![Dev Docs](https://docs.rs/fugue-ppl/badge.svg)](https://docs.rs/fugue-ppl) [![User Docs](https://img.shields.io/badge/guides-fugue.run-blue)](https://fugue.run) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) -[![CI](https://github.com/alexnodeland/fugue/actions/workflows/ci-develop.yml/badge.svg)](https://github.com/alexnodeland/fugue/actions/workflows/ci-develop.yml) -[![codecov](https://codecov.io/gh/alexnodeland/fugue/branch/develop/graph/badge.svg?token=BDJ5OB6GOB)](https://codecov.io/gh/alexnodeland/fugue) +[![CI](https://github.com/alexnodeland/fugue/actions/workflows/ci.yml/badge.svg)](https://github.com/alexnodeland/fugue/actions/workflows/ci.yml) +[![codecov](https://codecov.io/gh/alexnodeland/fugue/branch/main/graph/badge.svg?token=BDJ5OB6GOB)](https://codecov.io/gh/alexnodeland/fugue) [![Downloads](https://img.shields.io/crates/d/fugue-ppl?logo=rust)](https://crates.io/crates/fugue-ppl) [![Zotero](https://img.shields.io/badge/Zotero-Fugue-red?style=flat-square&logo=zotero&logoColor=CC2936)](https://www.zotero.org/groups/6138134/fugue/library) [![Discord](https://img.shields.io/discord/1412802057437712426?logo=discord&label=discord)](https://discord.gg/QAcF7Nwr) diff --git a/src/inference/abc.rs b/src/inference/abc.rs index 35d2ad1..2de7973 100644 --- a/src/inference/abc.rs +++ b/src/inference/abc.rs @@ -197,7 +197,7 @@ impl SummaryStatsDistance { let mut sorted = data.to_vec(); sorted.sort_by(|a, b| a.partial_cmp(b).unwrap()); - let median = if sorted.len() % 2 == 0 { + let median = if sorted.len().is_multiple_of(2) { (sorted[sorted.len() / 2 - 1] + sorted[sorted.len() / 2]) / 2.0 } else { sorted[sorted.len() / 2]