Changeset 13596


Ignore:
Timestamp:
Sep 25, 2019 10:31:31 AM (3 months ago)
Author:
randersson
Message:

#5819 Updated parser to simply skip all the empty elements, instead of skipping every element with even index which seemed to have been empty previously anyway. Also convert all elements to str in order to avoid any differences between python2 and python3 causing unicode/str/bytes in different cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-5819/Python/src/pyjmi/log/parser.py

    r13592 r13596  
    5858
    5959def parse_vector(text):
     60   
    6061    text = text.strip()
    6162    if text == "":
    6263        return np.zeros(0)
    6364    parts = comma_pattern.split(text)
    64     parts = parts[1::2]
     65    parts = filter(None, map(str, parts))
    6566    return np.asarray([parse_value(part) for part in parts])
    6667
Note: See TracChangeset for help on using the changeset viewer.