diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-08-31 16:47:29 +0200 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2017-10-17 20:35:30 +0200 |
commit | 8d8a3d26372d9c0a784e181121fc2b360f6fee51 (patch) | |
tree | b04d799efded02263306f3f41974ed4491b0d571 /python/astra | |
parent | 7b25c857ded357c0cb0b481dac6404c27ed0293d (diff) | |
download | astra-8d8a3d26372d9c0a784e181121fc2b360f6fee51.tar.gz astra-8d8a3d26372d9c0a784e181121fc2b360f6fee51.tar.bz2 astra-8d8a3d26372d9c0a784e181121fc2b360f6fee51.tar.xz astra-8d8a3d26372d9c0a784e181121fc2b360f6fee51.zip |
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.
Diffstat (limited to 'python/astra')
-rw-r--r-- | python/astra/utils.pyx | 2 |
1 files changed, 2 insertions, 0 deletions
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): |