Temporary resolve issues with new format metadata

This commit is contained in:
2022-05-06 15:54:12 +02:00
parent 7075e0f42b
commit 6f83292d69

View File

@@ -109,6 +109,7 @@ def parse_1D(fileobj, data_type):
variable = variable.strip() variable = variable.strip()
value = value.strip() value = value.strip()
try:
if variable in META_VARS_STR: if variable in META_VARS_STR:
metadata[variable] = value metadata[variable] = value
@@ -128,6 +129,10 @@ def parse_1D(fileobj, data_type):
row = int(variable[-2]) - 1 row = int(variable[-2]) - 1
metadata["ub"][row, :] = list(map(float, value.split())) metadata["ub"][row, :] = list(map(float, value.split()))
except Exception:
print(f"Error reading {variable} with value '{value}'")
metadata[variable] = 0
if "#data" in line: if "#data" in line:
# this is the end of metadata and the start of data section # this is the end of metadata and the start of data section
break break