import numpy

from ._helpers import C2Scheme


def product(scheme1d):
    schemes = scheme1d if isinstance(scheme1d, list) else 2 * [scheme1d]

    weights = numpy.outer(schemes[0].weights, schemes[1].weights).flatten()
    points = numpy.dstack(numpy.meshgrid(schemes[0].points, schemes[1].points)).reshape(
        -1, 2
    )
    points = numpy.ascontiguousarray(points.T)
    weights /= 4
    degree = min([s.degree for s in schemes])
    return C2Scheme(f"Product scheme ({scheme1d.name})", weights, points, degree)

@@ -236,14 +236,13 @@
 mpy.
-dstack
+array
 (num
@@ -304,74 +304,13 @@
 ape(
-%0A        -1, 2%0A    )%0A    points = numpy.ascontiguousarray(points.T
+2, -1
 )%0A  

simplify product scheme