ioos / cc-plugin-ugrid

Compliance Checker Plugin for UGRID: http://ugrid-conventions.github.io/ugrid-conventions
Apache License 2.0
3 stars 6 forks source link

test fail with 2D topo using a dimension other than nfaces #16

Open SBFRF opened 4 years ago

SBFRF commented 4 years ago

Hello, trying to utilze the checker to make a compliant file and thereby utilize some of the visualization packages. I ran my file and one of the tests checks the dimension name compared to number of dimensions. checker.py

         if cty == 'edge_node_connectivity':
            _dim1 = 'nedges'
            _dim2size = 2
        elif cty == 'face_node_connectivity':
            _dim1 = 'nfaces'
            _dim2size = 3
        else:
            raise NotImplementedError # haven't dealt with real 3D grids yet

In my case (2D), the logic ends up with _dim1 = 'nfaces' and _dim2size=3. if the dimension is anythin aside from nfaces for example nFaces or faces, when the comparison is made

        if (dim1.name == _dim1) and (dim2.size == _dim2size):
            # set the attr in the meshes dict
            self.meshes[mesh][_dim1] = self.ds.dimensions[_dim1]
            return True, 'regular'
        elif (dim1.size == _dim2size) and (dim2.name == _dim1):
            self.meshes[mesh][_dim1] = self.ds.dimensions[_dim1]
            return True, 'nonstd'
        else:
            return False, None

then the test fails. I don't see where in the UGRID document that the dimension name should be nfaces (exactly), infact the example uses nFaces or nMesh2_face for 2Dtopo Does the test need to be modified to not use such an explicit comparison or am I misinterpreting the conventions?