diff --git a/cython/pycddlib.pxi b/cython/pycddlib.pxi index a70055b..be4b4f2 100644 --- a/cython/pycddlib.pxi +++ b/cython/pycddlib.pxi @@ -549,14 +549,14 @@ cdef polyhedron_from_ptr(dd_PolyhedraPtr dd_poly): def polyhedron_from_matrix( - mat: Matrix, row_order_type: Optional[RowOrderType] = None + mat: Matrix, row_order: Optional[RowOrderType] = None ) -> Polyhedron: """Run the double description method to convert *mat* into a polyhedron, - using *row_order_type* if specified. + using *row_order* if specified. .. versionadded:: 3.0.0 - The *row_order_type* parameter. + The *row_order* parameter. """ if ( mat.dd_mat.representation != dd_Inequality @@ -564,10 +564,10 @@ def polyhedron_from_matrix( ): raise ValueError("rep_type must be INEQUALITY or GENERATOR") cdef dd_ErrorType error = dd_NoError - if row_order_type is None: + if row_order is None: dd_poly = dd_DDMatrix2Poly(mat.dd_mat, &error) else: - dd_poly = dd_DDMatrix2Poly2(mat.dd_mat, row_order_type, &error) + dd_poly = dd_DDMatrix2Poly2(mat.dd_mat, row_order, &error) if error != dd_NoError: dd_FreePolyhedra(dd_poly) _raise_error(error, "failed to run double description method") diff --git a/src/cdd/__init__.pyi b/src/cdd/__init__.pyi index 96ccdf4..3e57071 100644 --- a/src/cdd/__init__.pyi +++ b/src/cdd/__init__.pyi @@ -109,5 +109,5 @@ def matrix_from_array( obj_func: Optional[Sequence[SupportsNumberType]] = None, ) -> Matrix: ... def polyhedron_from_matrix( - mat: Matrix, row_order_type: Optional[RowOrderType] = None + mat: Matrix, row_order: Optional[RowOrderType] = None ) -> Polyhedron: ... diff --git a/src/cdd/gmp.pyi b/src/cdd/gmp.pyi index 8400968..5ac1953 100644 --- a/src/cdd/gmp.pyi +++ b/src/cdd/gmp.pyi @@ -77,5 +77,5 @@ def matrix_from_array( obj_func: Optional[Sequence[SupportsNumberType]] = None, ) -> Matrix: ... def polyhedron_from_matrix( - mat: Matrix, row_order_type: Optional[RowOrderType] = None + mat: Matrix, row_order: Optional[RowOrderType] = None ) -> Polyhedron: ... diff --git a/test/test_polyhedron.py b/test/test_polyhedron.py index cacb557..644e324 100644 --- a/test/test_polyhedron.py +++ b/test/test_polyhedron.py @@ -84,7 +84,7 @@ def test_polyhedron_cube_2() -> None: @pytest.mark.parametrize( - "row_order_type,order", + "row_order,order", [ (cdd.RowOrderType.MAX_INDEX, [2, 3, 0, 1]), (cdd.RowOrderType.MIN_INDEX, [2, 1, 0, 3]), @@ -95,13 +95,13 @@ def test_polyhedron_cube_2() -> None: (cdd.RowOrderType.LEX_MAX, [2, 3, 0, 1]), ], ) -def test_polyhedron_row_order_type( - row_order_type: Optional[cdd.RowOrderType], order: Sequence[int] +def test_polyhedron_row_order( + row_order: Optional[cdd.RowOrderType], order: Sequence[int] ) -> None: generators = [[1, 1, 0], [1, 0, 0], [1, 0, 1], [1, 1, 1]] inequalities = [[0, 0, 1], [0, 1, 0], [1, 0, -1], [1, -1, 0]] mat = cdd.matrix_from_array(inequalities, rep_type=cdd.RepType.INEQUALITY) - poly = cdd.polyhedron_from_matrix(mat, row_order_type=row_order_type) + poly = cdd.polyhedron_from_matrix(mat, row_order=row_order) print(cdd.copy_generators(poly).array) assert_matrix_almost_equal( cdd.copy_generators(poly).array, [generators[i] for i in order]