docstr: Test normals.
  
  Recall that the magnitude of each normal vector is equal to
  the area of the face it is normal to.
  
  We compare the abs value of each normal vector array because:
  note that the "normals" variable here calculates the normals
  as pointing out of the surface, but the way that normals()
  was constructed makes it so that the normal vector could be
  pointing into the surface or out of the surface, (so it could
  either be positive or negative). Because of this, we make all
  of the normal vectors to the cube positive for testing
  purposes.
docstr_tok: ["Test","normals",".","Recall","that","the","magnitude","of","each","normal","vector","is","equal","to","the","area","of","the","face","it","is","normal","to",".","We","compare","the","abs","value","of","each","normal","vector","array","because",":","note","that","the","``","normals","''","variable","here","calculates","the","normals","as","pointing","out","of","the","surface",",","but","the","way","that","normals","(",")","was","constructed","makes","it","so","that","the","normal","vector","could","be","pointing","into","the","surface","or","out","of","the","surface",",","(","so","it","could","either","be","positive","or","negative",")",".","Because","of","this",",","we","make","all","of","the","normal","vectors","to","the","cube","positive","for","testing","purposes","."]
code: def test_normals(self, point, expected, atol):
      """Test normals.
  
      Recall that the magnitude of each normal vector is equal to
      the area of the face it is normal to.
  
      We compare the abs value of each normal vector array because:
      note that the "normals" variable here calculates the normals
      as pointing out of the surface, but the way that normals()
      was constructed makes it so that the normal vector could be
      pointing into the surface or out of the surface, (so it could
      either be positive or negative). Because of this, we make all
      of the normal vectors to the cube positive for testing
      purposes.
      """
  
      def _check_normal(normal, normal_):
          self.assertTrue(
              gs.any(
                  [
                      gs.allclose(normal, normal_, atol=atol),
                      gs.allclose(normal, -normal_, atol=atol),
                  ]
              )
          )
  
      res = self.space.normals(point)
  
      n_points = get_n_points(self.space.point_ndim, point)
      if n_points == 1:
          res = gs.expand_dims(res, axis=0)
          expected = gs.expand_dims(expected, axis=0)
  
      for res_, expected_ in zip(res, expected):
          for normal, normal_ in zip(res_, expected_):
              _check_normal(normal, normal_)
  
file_path: geomstats/geomstats/test_cases/geometry/discrete_surfaces.py
imports: import geomstats.backend
  from geomstats.test_cases.geometry.manifold import ManifoldTestCase
  from geomstats.test_cases.geometry.riemannian_metric import RiemannianMetricTestCase
  from geomstats.vectorization import get_n_points
label_desc: Use image node_id 2 for calling the DiscreteSurfacesTestCase obj's underlying member method code with example usage: obj.test_normals(point, expected, atol) without return types