Skip to content

Commit

Permalink
Convert numpy slice to list
Browse files Browse the repository at this point in the history
  • Loading branch information
janvonrickenbach committed Feb 16, 2024
1 parent c99e426 commit 018e395
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/filter_layered_data_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 018e395

Please sign in to comment.