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
2 changes: 2 additions & 0 deletions c/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
- ``num_tracked_samples`` and ``num_samples`` in ``tsk_tree_t`` are now typed as ``tsk_size_t``
(:user:`benjeffery`, :issue:`1723`, :pr:`1727`)

- The previously deprecated option ``TSK_SAMPLE_COUNTS`` has been removed. (:user:`benjeffery`, :issue:`1744`, :pr:`1761`).


**Features**

Expand Down
16 changes: 0 additions & 16 deletions c/tests/test_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,21 +386,6 @@ test_debug_stream(void)
fclose(f);
}

static void
test_warn_stream(void)
{
FILE *f = fopen(_tmp_file_name, "w");
CU_ASSERT_FATAL(tsk_get_warn_stream() == stderr);
CU_ASSERT_FATAL(tsk_get_warn_stream() == stderr);

tsk_set_warn_stream(f);
CU_ASSERT_FATAL(tsk_get_warn_stream() == f);
tsk_set_warn_stream(stderr);
CU_ASSERT_FATAL(tsk_get_warn_stream() == stderr);

fclose(f);
}

static int
validate_avl_node(tsk_avl_node_int_t *node)
{
Expand Down Expand Up @@ -552,7 +537,6 @@ main(int argc, char **argv)
{ "test_malloc_zero", test_malloc_zero },
{ "test_malloc_overflow", test_malloc_overflow },
{ "test_debug_stream", test_debug_stream },
{ "test_warn_stream", test_warn_stream },
{ "test_avl_empty", test_avl_empty },
{ "test_avl_sequential", test_avl_sequential },
{ "test_avl_interleaved", test_avl_interleaved },
Expand Down
25 changes: 0 additions & 25 deletions c/tests/test_trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -6135,30 +6135,6 @@ test_zero_edges(void)
tsk_treeseq_free(&tss);
}

static void
test_sample_counts_deprecated(void)
{
tsk_treeseq_t ts;
tsk_tree_t tree;
int ret;
FILE *f = fopen(_tmp_file_name, "w");

tsk_treeseq_from_text(&ts, 1, single_tree_ex_nodes, single_tree_ex_edges, NULL, NULL,
NULL, NULL, NULL, 0);
CU_ASSERT_EQUAL(tsk_treeseq_get_num_samples(&ts), 4);

tsk_set_warn_stream(f);
ret = tsk_tree_init(&tree, &ts, TSK_SAMPLE_COUNTS);
tsk_set_warn_stream(stderr);
CU_ASSERT_EQUAL_FATAL(ret, 0);

CU_ASSERT_FATAL(ftell(f) > 0);

fclose(f);
tsk_tree_free(&tree);
tsk_treeseq_free(&ts);
}

static void
test_tree_sequence_metadata(void)
{
Expand Down Expand Up @@ -6363,7 +6339,6 @@ main(int argc, char **argv)
{ "test_deduplicate_sites_multichar", test_deduplicate_sites_multichar },
{ "test_empty_tree_sequence", test_empty_tree_sequence },
{ "test_zero_edges", test_zero_edges },
{ "test_sample_counts_deprecated", test_sample_counts_deprecated },
{ "test_tree_sequence_metadata", test_tree_sequence_metadata },

{ NULL, NULL },
Expand Down
20 changes: 2 additions & 18 deletions c/tskit/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,13 +814,12 @@ tsk_memcmp(const void *s1, const void *s2, tsk_size_t size)
return memcmp(s1, s2, (size_t) size);
}

/* We can't initialise the streams to their real default values because
/* We can't initialise the stream to its real default value because
* of limitations on static initialisers. To work around this, we initialise
* them to NULL and then set the value to the required standard stream
* it to NULL and then set the value to the required standard stream
* when called. */

FILE *_tsk_debug_stream = NULL;
FILE *_tsk_warn_stream = NULL;

void
tsk_set_debug_stream(FILE *f)
Expand All @@ -837,21 +836,6 @@ tsk_get_debug_stream(void)
return _tsk_debug_stream;
}

void
tsk_set_warn_stream(FILE *f)
{
_tsk_warn_stream = f;
}

FILE *
tsk_get_warn_stream(void)
{
if (_tsk_warn_stream == NULL) {
_tsk_warn_stream = stderr;
}
return _tsk_warn_stream;
}

/* AVL Tree implementation. This is based directly on Knuth's implementation
* in TAOCP. See the python/tests/test_avl_tree.py for more information,
* and equivalent code annotated with the original algorithm listing.
Expand Down
2 changes: 0 additions & 2 deletions c/tskit/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,6 @@ int tsk_memcmp(const void *s1, const void *s2, tsk_size_t size);
/* Developer debug utilities. These are **not** threadsafe */
void tsk_set_debug_stream(FILE *f);
FILE *tsk_get_debug_stream(void);
void tsk_set_warn_stream(FILE *f);
FILE *tsk_get_warn_stream(void);

#ifdef __cplusplus
}
Expand Down
6 changes: 0 additions & 6 deletions c/tskit/trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -3220,12 +3220,6 @@ tsk_tree_init(tsk_tree_t *self, const tsk_treeseq_t *tree_sequence, tsk_flags_t
ret = TSK_ERR_BAD_PARAM_VALUE;
goto out;
}
if (options & TSK_SAMPLE_COUNTS) {
fprintf(tsk_get_warn_stream(),
"TSK_SAMPLE_COUNTS is no longer supported. "
"Sample counts are tracked by default since 0.99.3, "
"Please use TSK_NO_SAMPLE_COUNTS to turn off sample counts.");
}
num_nodes = tree_sequence->tables->nodes.num_rows;
num_samples = tree_sequence->num_samples;
self->num_nodes = num_nodes;
Expand Down
6 changes: 0 additions & 6 deletions c/tskit/trees.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,7 @@ extern "C" {

#include <tskit/tables.h>

/* The TSK_SAMPLE_COUNTS was removed in version 0.99.3, where
* the default is now to always count samples except when
* TSK_NO_SAMPLE_COUNTS is specified. This macro can be undefined
* at some point in the future and the option reused for something
* else. */
// clang-format off
#define TSK_SAMPLE_COUNTS (1 << 0)
#define TSK_SAMPLE_LISTS (1 << 1)
#define TSK_NO_SAMPLE_COUNTS (1 << 2)

Expand Down