Skip to content
Snippets Groups Projects
Commit e2ca62c4 authored by Jan David Mol's avatar Jan David Mol
Browse files

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

parent de1b1c0e
No related branches found
No related tags found
Loading
...@@ -197,16 +197,16 @@ class ProtocolAttribute: ...@@ -197,16 +197,16 @@ class ProtocolAttribute:
""" """
Read_R function Read_R function
""" """
value = numpy.array(self.node.get_value()) value = self.node.get_value()
if self.dim_y + self.dim_x == 1: if self.dim_y + self.dim_x == 1:
# scalar # scalar
return value return value
elif self.dim_y != 0: elif self.dim_y != 0:
value = numpy.array(numpy.split(value, indices_or_sections=self.dim_y)) # 2D array
elif self.dim_y + self.dim_x == 1: value = numpy.array(numpy.split(numpy.array(value), indices_or_sections=self.dim_y))
value = [numpy.array(value)]
else: else:
# 1D array
value = numpy.array(value) value = numpy.array(value)
return value return value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment