Skip to content

Commit d88a4b7

Browse files
committed
Remove derived state check
1 parent 4bf2521 commit d88a4b7

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
- Drop Python 3.9 support, require Python >= 3.10 ({pr}`1044`, {user}`benjeffery`)
88

9+
- Remove overzealous derived state validation in C API. ({user}`benjeffery`)
10+
11+
912
## [0.4.1] - 2024-04-19
1013

1114
** Changes **

lib/err.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,6 @@ tsi_strerror(int err)
8888
case TSI_ERR_BAD_MUTATION_SITE:
8989
ret = "Bad mutation information: site";
9090
break;
91-
case TSI_ERR_BAD_MUTATION_DERIVED_STATE:
92-
ret = "Bad mutation information: derived state";
93-
break;
9491
case TSI_ERR_BAD_MUTATION_DUPLICATE_NODE:
9592
ret = "Bad mutation information: mutation already exists for this node.";
9693
break;

lib/err.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#define TSI_ERR_BAD_NUM_ALLELES -14
1919
#define TSI_ERR_BAD_MUTATION_NODE -15
2020
#define TSI_ERR_BAD_MUTATION_SITE -16
21-
#define TSI_ERR_BAD_MUTATION_DERIVED_STATE -17
21+
// -17 used to be TSI_ERR_BAD_MUTATION_DERIVED_STATE
2222
#define TSI_ERR_BAD_MUTATION_DUPLICATE_NODE -18
2323
#define TSI_ERR_BAD_NUM_SAMPLES -19
2424
#define TSI_ERR_TOO_MANY_SITES -20

lib/tree_sequence_builder.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,6 @@ tree_sequence_builder_add_mutation(
423423
ret = TSI_ERR_BAD_MUTATION_SITE;
424424
goto out;
425425
}
426-
if (derived_state < 0 || derived_state >= (allele_t) self->sites.num_alleles[site]) {
427-
ret = TSI_ERR_BAD_MUTATION_DERIVED_STATE;
428-
goto out;
429-
}
430426
/* Make sure there are no other mutations on this node */
431427
for (list_node = self->sites.mutations[site]; list_node != NULL;
432428
list_node = list_node->next) {

0 commit comments

Comments
 (0)