Skip to content

Commit 1f8574a

Browse files
committed
Update pre-commit
1 parent bd98456 commit 1f8574a

8 files changed

+25
-29
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-merge-conflict
66
- id: debug-statements
@@ -14,29 +14,29 @@ repos:
1414
exclude: avl
1515
verbose: true
1616
- repo: https://github.com/asottile/reorder_python_imports
17-
rev: v3.9.0
17+
rev: v3.14.0
1818
hooks:
1919
- id: reorder-python-imports
2020
args: [ --unclassifiable-application-module=_tsinfer ]
2121
- repo: https://github.com/asottile/pyupgrade
22-
rev: v3.2.2
22+
rev: v3.19.1
2323
hooks:
2424
- id: pyupgrade
2525
args: [ --py3-plus, --py39-plus ]
2626
- repo: https://github.com/psf/black
27-
rev: 22.10.0
27+
rev: 25.1.0
2828
hooks:
2929
- id: black
3030
language_version: python3
3131
- repo: https://github.com/asottile/blacken-docs
32-
rev: v1.12.1
32+
rev: 1.19.1
3333
hooks:
3434
- id: blacken-docs
3535
args: [--skip-errors]
3636
additional_dependencies: [black==22.3.0]
3737
language_version: python3
3838
- repo: https://github.com/pycqa/flake8
39-
rev: 6.0.0
39+
rev: 7.1.2
4040
hooks:
4141
- id: flake8
4242
args: [--config=.flake8]

convert_hdf5.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
"""
2-
Simple script to convert input data into HDF5 format so that
3-
we can feed it into the C development CLI.
4-
"""
1+
# Simple script to convert input data into HDF5 format so that
2+
# we can feed it into the C development CLI.
53
import sys
64

75
import h5py

evaluation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Script for statistically evaluating various aspects of tsinfer performance.
3-
"""
1+
# Script for statistically evaluating various aspects of tsinfer performance.
42
import argparse
53
import concurrent.futures
64
import json

tests/test_variantdata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,9 @@ def test_sgkit_sample_and_site_mask(self, tmp_path):
584584
# Mask out a random 1/3 of sites
585585
variant_mask = np.zeros(ts.num_sites, dtype=bool)
586586
random = np.random.RandomState(42)
587-
variant_mask[
588-
random.choice(ts.num_sites, ts.num_sites // 3, replace=False)
589-
] = True
587+
variant_mask[random.choice(ts.num_sites, ts.num_sites // 3, replace=False)] = (
588+
True
589+
)
590590
# Mask out a random 1/3 of samples
591591
samples_mask = np.zeros(ts.num_individuals, dtype=bool)
592592
samples_mask[

tsinfer/formats.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,9 +1019,9 @@ def __init__(self, sequence_length=0, **kwargs):
10191019

10201020
self.data.attrs["sequence_length"] = float(sequence_length)
10211021
self.data.attrs["metadata"] = {}
1022-
self.data.attrs[
1023-
"metadata_schema"
1024-
] = tskit.MetadataSchema.permissive_json().schema
1022+
self.data.attrs["metadata_schema"] = (
1023+
tskit.MetadataSchema.permissive_json().schema
1024+
)
10251025
chunks = (self._chunk_size,)
10261026
populations_group = self.data.create_group("populations")
10271027
metadata = populations_group.create_dataset(
@@ -3615,9 +3615,9 @@ def flush_buffers(buffer_pos):
36153615
end_buffer[buffer_pos] = insert_pos_end
36163616
time_buffer[buffer_pos] = anc.time
36173617
focal_sites_buffer[buffer_pos] = anc.focal_sites
3618-
haplotype_buffer[
3619-
insert_pos_start:insert_pos_end, buffer_pos, 0
3620-
] = anc.full_haplotype[insert_pos_start:insert_pos_end]
3618+
haplotype_buffer[insert_pos_start:insert_pos_end, buffer_pos, 0] = (
3619+
anc.full_haplotype[insert_pos_start:insert_pos_end]
3620+
)
36213621
buffer_pos += 1
36223622
if buffer_pos == buffer_length:
36233623
flush_buffers(buffer_length)

tsinfer/inference.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2502,9 +2502,11 @@ def __complete_group(self, group, ancestor_ids, results):
25022502
group,
25032503
len(ancestor_ids),
25042504
extra_nodes,
2505-
sum(result.mean_traceback_size for result in results) / len(results)
2506-
if len(results) > 0
2507-
else float("nan"),
2505+
(
2506+
sum(result.mean_traceback_size for result in results) / len(results)
2507+
if len(results) > 0
2508+
else float("nan")
2509+
),
25082510
self.tree_sequence_builder.num_edges,
25092511
)
25102512
)

tsinfer/progress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def get(self, key, total):
9191
dynamic_ncols=True,
9292
smoothing=0.01,
9393
unit_scale=True,
94-
**self.tqdm_kwargs
94+
**self.tqdm_kwargs,
9595
)
9696
return self.current_instance
9797

visualisation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Visualisation of the copying process and ancestor generation using PIL
3-
"""
1+
# Visualisation of the copying process and ancestor generation using PIL
42
import os
53
import sys
64

0 commit comments

Comments
 (0)