From 8d8a3d26372d9c0a784e181121fc2b360f6fee51 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 31 Aug 2017 16:47:29 +0200 Subject: Add trailing ,/; to string repr of float vector/matrix This makes it possible to differentiate between a scalar and a one-element vector, and fixes #111. --- python/astra/utils.pyx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'python/astra/utils.pyx') diff --git a/python/astra/utils.pyx b/python/astra/utils.pyx index a40916b..bcff6c3 100644 --- a/python/astra/utils.pyx +++ b/python/astra/utils.pyx @@ -171,6 +171,7 @@ def stringToPythonValue(inputIn): input = castString(inputIn) # matrix if ';' in input: + input = input.rstrip(';') row_strings = input.split(';') col_strings = row_strings[0].split(',') nRows = len(row_strings) @@ -185,6 +186,7 @@ def stringToPythonValue(inputIn): # vector if ',' in input: + input = input.rstrip(',') items = input.split(',') out = np.empty(len(items)) for idx,item in enumerate(items): -- cgit v1.2.3