From d6ce959479d0c9eff179fb7f67ccb3c536e1ce17 Mon Sep 17 00:00:00 2001 From: janvonrickenbach Date: Mon, 19 Feb 2024 13:33:19 +0100 Subject: [PATCH] Convert numpy slice to list to fix test (#425) Convert numpy slice to list --- tests/filter_layered_data_test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/filter_layered_data_test.py b/tests/filter_layered_data_test.py index 90b59954a..3c621fede 100644 --- a/tests/filter_layered_data_test.py +++ b/tests/filter_layered_data_test.py @@ -77,8 +77,11 @@ def get_result_field( element_info, layers=layers, nodes=corner_nodes, spots=spots ) - value = strain_data[selected_indices][:, component] - local_result_field.append(value, element_id) + values = strain_data[selected_indices][:, component] + # Conversion to a list is a temporary workaround + # because the append method does currently not work + # reliably for slices of numpy arrays + local_result_field.append(list(values), element_id) else: local_result_field.append(strain_data[selected_indices, component], element_id) return result_field