Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,13 @@ name: Tests
on:
pull_request:
push:
branches: [main]
branches: [main, test]
merge_group:

jobs:
pre-commit:
name: Lint
runs-on: ubuntu-24.04
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5.4.0
- name: install clang-format
run: |
pip install clang-format==6.0.1
- uses: pre-commit/action@v3.0.1
uses: tskit-dev/.github/.github/workflows/lint.yml@v2

test:
name: Python
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: check-merge-conflict
- id: debug-statements
Expand All @@ -14,12 +14,12 @@ repos:
exclude: argtable3
verbose: true
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.14.0
rev: v3.15.0
hooks:
- id: reorder-python-imports
args: [--unclassifiable-application-module=_msprime]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
rev: v3.20.0
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand All @@ -29,7 +29,7 @@ repos:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 7.1.2
rev: 7.3.0
hooks:
- id: flake8
args: [--config=.flake8]
Expand Down
2 changes: 1 addition & 1 deletion lib/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ fast_search_alloc(fast_search_t *self, const double *elements, size_t n_elements
* of the array. The rest of the lookup element indexes point to (max_element *
* query_multiplier) non-zero element values.
*/
self->num_lookups = 2 + (size_t) (max_element * self->query_multiplier);
self->num_lookups = 2 + (size_t)(max_element * self->query_multiplier);

self->query_cutoff = ((double) self->num_lookups - 1) / self->query_multiplier;

Expand Down
4 changes: 2 additions & 2 deletions msprime/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def clear_seed_rng():


def get_random_seed() -> int:
global _seed_rng_map
global _seed_rng_map # noqa: F824
pid = os.getpid()
if pid not in _seed_rng_map:
# If we don't provide a seed to Random(), Python will seed either
Expand All @@ -87,7 +87,7 @@ def set_seed_rng_seed(seed: int):

DO NOT USE THIS FUNCTION!!!
"""
global _seed_rng_map
global _seed_rng_map # noqa: F824
pid = os.getpid()
_seed_rng_map[pid] = random.Random(seed)

Expand Down
Loading