diff options
author | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-01-15 13:11:12 +0100 |
---|---|---|
committer | Birte Kristina Friesel <birte.friesel@uos.de> | 2024-01-15 13:11:12 +0100 |
commit | 4a4e3fa7074d176af516b7766a15659f6ba6fc0c (patch) | |
tree | ea251914169da1448d7a2dd8a5faba46c90c2435 | |
parent | e8217a9a95cf4430b37556e174211a444d3c2f21 (diff) |
dtree: replace condition by assertion
-rw-r--r-- | lib/parameters.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/parameters.py b/lib/parameters.py index feb3b82..5673593 100644 --- a/lib/parameters.py +++ b/lib/parameters.py @@ -1325,17 +1325,17 @@ class ModelAttribute: ) child_parameters = list(map(lambda i: parameters[i], indexes)) child_data = list(map(lambda i: data[i], indexes)) - if len(child_data): - child[value] = self._build_dtree( - child_parameters, - child_data, - with_function_leaves=with_function_leaves, - with_nonbinary_nodes=with_nonbinary_nodes, - ignore_irrelevant_parameters=ignore_irrelevant_parameters, - loss_ignore_scalar=loss_ignore_scalar, - threshold=threshold, - level=level + 1, - ) + assert len(child_data) + child[value] = self._build_dtree( + child_parameters, + child_data, + with_function_leaves=with_function_leaves, + with_nonbinary_nodes=with_nonbinary_nodes, + ignore_irrelevant_parameters=ignore_irrelevant_parameters, + loss_ignore_scalar=loss_ignore_scalar, + threshold=threshold, + level=level + 1, + ) assert len(child.values()) >= 2 |