Name == 3_S_8_room-0_wall7
^
SyntaxError: invalid decimal literal
Obviously it takes my string value as a number, due to leading decimal. Also, in case I put underscore in front of the string _3_S_8_qwerty-0_ytrewq7 it will give me the same error but related to the text after minus char.
So the question is: are there any ways to set that string as a value to compare to (without changing/encoding/normalizing the Name values as input)?
PS: quotes didn’t help.
PPS: i know that it supports numpy features. Maybe there is something I’ve missed regarding strings comparison?
Sorry, I’m not allowed to share it here. But I can describe how it is being generated.
CellData is extended on import by manually added String arrays. Name array is added along with them.
Input is a vtp, where each piece has some metadata added along with tag: <Piece Name="3_S_8_qwerty-0_ytrewq7">
We parse the file with vtkXMLPolyDataReader and generate a MultiblockDataSet as our custom reader’s output. Along with copying every piece to a separate block, we read metadata from the same file using xml.etree.ElementTree. The metadata values are added as a separate vtkStringArray to the block’s CellData.
PS: Hope I didn’t describe it too complicated.
PPS: maybe there is a better way to get attributes per piece from vtkXMLPolyDataReader directly.
I suspect that you are seeing underscore grouping PEP 515 – Underscores in Numeric Literals | peps.python.org. It is probably seeing the underscore after the digit as a grouping for numeric values so it’s treating the string as numeric hence the error. Escaping the underscore might fix it.