Skip to content

Commit 1641b60

Browse files
Update _tskitmodule.c for recent clang-format
1 parent 7f3b82e commit 1641b60

1 file changed

Lines changed: 30 additions & 46 deletions

File tree

python/_tskitmodule.c

Lines changed: 30 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
#define NPY_NO_DEPRECATED_API NPY_2_0_API_VERSION
3737
#undef NPY_FEATURE_VERSION
3838
#define NPY_FEATURE_VERSION NPY_2_0_API_VERSION
39-
#define HAVE_NUMPY_2 1
39+
#define HAVE_NUMPY_2 1
4040
#else
4141
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
42-
#define HAVE_NUMPY_2 0
42+
#define HAVE_NUMPY_2 0
4343
#endif
4444
#include <numpy/arrayobject.h>
4545

@@ -49,7 +49,7 @@
4949
#include "kastore.h"
5050
#include "tskit.h"
5151

52-
#define SET_COLS 0
52+
#define SET_COLS 0
5353
#define APPEND_COLS 1
5454

5555
/* TskitException is the superclass of all exceptions that can be thrown by
@@ -6216,15 +6216,11 @@ TreeSequence_decode_alignments(TreeSequence *self, PyObject *args, PyObject *kwd
62166216
}
62176217
buf = PyBytes_AS_STRING(buf_obj);
62186218

6219-
// clang-format off
6220-
Py_BEGIN_ALLOW_THREADS
6221-
err = tsk_treeseq_decode_alignments(self->tree_sequence,
6222-
ref_seq, (tsk_size_t) ref_len, nodes, num_nodes, left, right, missing_char, buf,
6223-
options);
6219+
Py_BEGIN_ALLOW_THREADS
6220+
err = tsk_treeseq_decode_alignments(self->tree_sequence, ref_seq,
6221+
(tsk_size_t) ref_len, nodes, num_nodes, left, right, missing_char, buf, options);
62246222
Py_END_ALLOW_THREADS
6225-
// clang-format on
6226-
if (err != 0)
6227-
{
6223+
if (err != 0) {
62286224
handle_library_error(err);
62296225
goto out;
62306226
}
@@ -6337,11 +6333,12 @@ TreeSequence_genealogical_nearest_neighbours(
63376333
goto out;
63386334
}
63396335

6340-
Py_BEGIN_ALLOW_THREADS err = tsk_treeseq_genealogical_nearest_neighbours(
6341-
self->tree_sequence, PyArray_DATA(focal_array), num_focal, reference_sets,
6342-
reference_set_size, num_reference_sets, 0, PyArray_DATA(ret_array));
6343-
Py_END_ALLOW_THREADS if (err != 0)
6344-
{
6336+
Py_BEGIN_ALLOW_THREADS
6337+
err = tsk_treeseq_genealogical_nearest_neighbours(self->tree_sequence,
6338+
PyArray_DATA(focal_array), num_focal, reference_sets, reference_set_size,
6339+
num_reference_sets, 0, PyArray_DATA(ret_array));
6340+
Py_END_ALLOW_THREADS
6341+
if (err != 0) {
63456342
handle_library_error(err);
63466343
goto out;
63476344
}
@@ -6457,11 +6454,11 @@ TreeSequence_mean_descendants(TreeSequence *self, PyObject *args, PyObject *kwds
64576454
goto out;
64586455
}
64596456

6460-
Py_BEGIN_ALLOW_THREADS err
6461-
= tsk_treeseq_mean_descendants(self->tree_sequence, reference_sets,
6462-
reference_set_size, num_reference_sets, 0, PyArray_DATA(ret_array));
6463-
Py_END_ALLOW_THREADS if (err != 0)
6464-
{
6457+
Py_BEGIN_ALLOW_THREADS
6458+
err = tsk_treeseq_mean_descendants(self->tree_sequence, reference_sets,
6459+
reference_set_size, num_reference_sets, 0, PyArray_DATA(ret_array));
6460+
Py_END_ALLOW_THREADS
6461+
if (err != 0) {
64656462
handle_library_error(err);
64666463
goto out;
64676464
}
@@ -7265,12 +7262,12 @@ TreeSequence_weighted_stat_vector_method(
72657262
if (result_array == NULL) {
72667263
goto out;
72677264
}
7268-
Py_BEGIN_ALLOW_THREADS err
7269-
= method(self->tree_sequence, w_shape[1], PyArray_DATA(weights_array),
7270-
num_windows, PyArray_DATA(windows_array), num_focal_nodes,
7271-
PyArray_DATA(focal_nodes_array), PyArray_DATA(result_array), options);
7272-
Py_END_ALLOW_THREADS if (err != 0)
7273-
{
7265+
Py_BEGIN_ALLOW_THREADS
7266+
err = method(self->tree_sequence, w_shape[1], PyArray_DATA(weights_array),
7267+
num_windows, PyArray_DATA(windows_array), num_focal_nodes,
7268+
PyArray_DATA(focal_nodes_array), PyArray_DATA(result_array), options);
7269+
Py_END_ALLOW_THREADS
7270+
if (err != 0) {
72747271
handle_library_error(err);
72757272
goto out;
72767273
}
@@ -7492,18 +7489,12 @@ TreeSequence_divergence_matrix(TreeSequence *self, PyObject *args, PyObject *kwd
74927489
options |= TSK_STAT_SPAN_NORMALISE;
74937490
}
74947491

7495-
// clang-format off
74967492
Py_BEGIN_ALLOW_THREADS
7497-
err = tsk_treeseq_divergence_matrix(
7498-
self->tree_sequence,
7499-
num_sample_sets, sample_set_sizes, sample_sets,
7500-
num_windows, PyArray_DATA(windows_array),
7501-
options, PyArray_DATA(result_array));
7493+
err = tsk_treeseq_divergence_matrix(self->tree_sequence, num_sample_sets,
7494+
sample_set_sizes, sample_sets, num_windows, PyArray_DATA(windows_array), options,
7495+
PyArray_DATA(result_array));
75027496
Py_END_ALLOW_THREADS
7503-
// clang-format on
7504-
/* Clang-format insists on doing this in spite of the "off" instruction above */
7505-
if (err != 0)
7506-
{
7497+
if (err != 0) {
75077498
handle_library_error(err);
75087499
goto out;
75097500
}
@@ -8035,17 +8026,13 @@ TreeSequence_ld_matrix(TreeSequence *self, PyObject *args, PyObject *kwds,
80358026
goto out;
80368027
}
80378028

8038-
// clang-format off
80398029
Py_BEGIN_ALLOW_THREADS
80408030
err = method(self->tree_sequence, num_sample_sets,
80418031
PyArray_DATA(sample_set_sizes_array), PyArray_DATA(sample_sets_array),
80428032
result_dim[0], row_sites_parsed, row_positions_parsed, result_dim[1],
80438033
col_sites_parsed, col_positions_parsed, options, PyArray_DATA(result_matrix));
80448034
Py_END_ALLOW_THREADS
8045-
// clang-format on
8046-
8047-
if (err != 0)
8048-
{
8035+
if (err != 0) {
80498036
handle_library_error(err);
80508037
goto out;
80518038
}
@@ -8218,17 +8205,14 @@ TreeSequence_k_way_ld_matrix(TreeSequence *self, PyObject *args, PyObject *kwds,
82188205
goto out;
82198206
}
82208207

8221-
// clang-format off
82228208
Py_BEGIN_ALLOW_THREADS
82238209
err = method(self->tree_sequence, num_sample_sets,
82248210
PyArray_DATA(sample_set_sizes_array), PyArray_DATA(sample_sets_array),
82258211
num_set_index_tuples, PyArray_DATA(indexes_array), result_dim[0],
82268212
row_sites_parsed, row_positions_parsed, result_dim[1], col_sites_parsed,
82278213
col_positions_parsed, options, PyArray_DATA(result_matrix));
82288214
Py_END_ALLOW_THREADS
8229-
// clang-format on
8230-
if (err != 0)
8231-
{
8215+
if (err != 0) {
82328216
handle_library_error(err);
82338217
goto out;
82348218
}

0 commit comments

Comments
 (0)