.upper() because 'keywords are case insensitive'
@@ -125,7 +125,7 @@ def read_buffer(f):
f.readline()
f.readline()
- data_type = f.readline().decode("utf-8").strip()
+ data_type = f.readline().decode("utf-8").strip().upper()
assert data_type in ["ASCII", "BINARY"], "Unknown VTK data type '{}'.".format(
data_type
)
@@ -152,10 +152,10 @@ def read_buffer(f):
continue
split = line.split()
- section = split[0]
+ section = split[0].upper()
if section == "DATASET":
- dataset_type = split[1]
+ dataset_type = split[1].upper()
assert (
dataset_type == "UNSTRUCTURED_GRID"
), "Only VTK UNSTRUCTURED_GRID supported (not {}).".format(
@@ -165,7 +165,7 @@ def read_buffer(f):
elif section == "POINTS":
active = "POINTS"
num_points = int(split[1])
- data_type = split[2]
+ data_type = split[2].upper()
points = _read_points(f, data_type, is_ascii, num_points)
elif section == "CELLS":
