Skip to content
Snippets Groups Projects
Commit 439cab71 authored by Taya Snijder's avatar Taya Snijder
Browse files

Merge branch 'L2SS-347-fix-reading-strings' into 'master'

L2SS-347: Deal with reading scalar values correctly, that is, do not convert them into arrays.

Closes L2SS-347

See merge request !100
parents 6d43796e e2ca62c4
No related branches found
No related tags found
1 merge request!100L2SS-347: Deal with reading scalar values correctly, that is, do not convert them into arrays.
......@@ -197,16 +197,16 @@ class ProtocolAttribute:
"""
Read_R function
"""
value = numpy.array(self.node.get_value())
value = self.node.get_value()
if self.dim_y + self.dim_x == 1:
# scalar
return value
elif self.dim_y != 0:
value = numpy.array(numpy.split(value, indices_or_sections=self.dim_y))
elif self.dim_y + self.dim_x == 1:
value = [numpy.array(value)]
# 2D array
value = numpy.array(numpy.split(numpy.array(value), indices_or_sections=self.dim_y))
else:
# 1D array
value = numpy.array(value)
return value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment