Skip to content

Commit

Permalink
Summary lists optional connectivities : no tests yet : disabled compl…
Browse files Browse the repository at this point in the history
…exity checks.
  • Loading branch information
pp-mo committed Feb 21, 2022
1 parent 75284ab commit 7d1a6a4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/ugrid_checks/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,6 +1560,21 @@ def varlist_str(var: NcVariableSummary, attr_name: str) -> str:
if coord_name in mesh_var.attributes:
coords = varlist_str(mesh_var, coord_name)
line(f"coordinates : {coords}", 3)
# List *optional* connectivities of the mesh
# N.B. "<x>_node..." are required : shown above with location
# All others are 'optional' : list these in a separate section
optional_conns = []
for attr_name in _VALID_CONNECTIVITY_ROLES:
if attr_name.split("_")[1] != "node":
attr_value = property_as_single_name(
mesh_var.attributes.get(attr_name)
)
if attr_value:
optional_conns.append((attr_name, attr_value))
if optional_conns:
line("optional connectivities", 2)
for attr_name, attr_value in optional_conns:
line(f'{attr_name} : "{attr_value}"', 3)

if self._lis_vars:
line("")
Expand Down

0 comments on commit 7d1a6a4

Please sign in to comment.