Commit 072ef8c3 authored by cponcele's avatar cponcele
Browse files

fix bug in enum declaration

parent bc8f44ff
......@@ -37,7 +37,7 @@ class SonarChecker:
if not path.endswith("/"):
path = path + "/"
for name in self.classes.items():
for name in self.classes.keys():
pattern = self.classes[name].get_group_path_pattern()
match = re.fullmatch(pattern, path)
if match:
......@@ -51,17 +51,12 @@ class SonarChecker:
self._warning(f"Cannot match any known group definition for {dataset.path}")
return
# vlen type
for expected_type in validator_class._vlen_types:
if expected_type not in dataset.vltypes:
self._error(f"Missing vlen type declaration {expected_type} expected in {dataset.path}")
for expected_type in validator_class._enum_types:
if expected_type not in dataset.vltypes:
if expected_type not in dataset.enumtypes:
self._error(f"Missing enum declaration {expected_type} expected in {dataset.path}")
for expected_type in validator_class._vlen_types:
if expected_type not in dataset.enumtypes:
if expected_type not in dataset.vltypes:
self._error(f"Missing vlen type declaration {expected_type} expected in {dataset.path}")
# compound types not done
......@@ -121,6 +116,6 @@ if __name__ == "__main__":
#"c:/data/datasets/netcdfInspector/GLOBE_MERGED_GAZCOGNE3_003_20180829_061940_1.xsf_TO_GAZCOGNE3_003_20180829_070941_1.xsf_v783u7_w_ES333-7C-333000.nc"
for file in glob.glob(r"C:\data\datasets\SonarNetcdf\PHOENIX*.nc"):
for file in glob.glob(r"C:\data\datasets\SonarNetcdf\PELGAS13_003_20130428_145634_1*.nc"):
checker = SonarChecker()
checker.validate_file(file)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment