From cd28bae01d1613cd117f17326a14463d841c311a Mon Sep 17 00:00:00 2001 From: jorgensd Date: Thu, 5 Dec 2024 20:23:18 +0000 Subject: [PATCH] Update stubs --- python/basix/_basixcpp.pyi | 84 +++++++++++++++++++------------------- python/wrapper.cpp | 14 +++---- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/python/basix/_basixcpp.pyi b/python/basix/_basixcpp.pyi index e78e5d913..410532410 100644 --- a/python/basix/_basixcpp.pyi +++ b/python/basix/_basixcpp.pyi @@ -75,19 +75,19 @@ class ElementFamily(enum.IntEnum): iso = 13 class FiniteElement_float32: - def tabulate(self, arg0: int, arg1: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None), order='C')], /) -> Annotated[ArrayLike, dict(dtype='float32', )]: ... + def tabulate(self, arg0: int, arg1: Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), order='C', writable=False)], /) -> Annotated[ArrayLike, dict(dtype='float32')]: ... def __eq__(self, arg: object, /) -> bool: ... def hash(self) -> int: ... - def permute_subentity_closure(self, arg0: Annotated[ArrayLike, dict(dtype='int32', shape=(None), order='C')], arg1: int, arg2: CellType, /) -> Annotated[ArrayLike, dict(dtype='int32', )]: ... + def permute_subentity_closure(self, arg0: Annotated[ArrayLike, dict(dtype='int32', shape=(None), order='C')], arg1: int, arg2: CellType, /) -> Annotated[ArrayLike, dict(dtype='int32')]: ... - def permute_subentity_closure_inv(self, arg0: Annotated[ArrayLike, dict(dtype='int32', shape=(None), order='C')], arg1: int, arg2: CellType, /) -> Annotated[ArrayLike, dict(dtype='int32', )]: ... + def permute_subentity_closure_inv(self, arg0: Annotated[ArrayLike, dict(dtype='int32', shape=(None), order='C')], arg1: int, arg2: CellType, /) -> Annotated[ArrayLike, dict(dtype='int32')]: ... - def push_forward(self, arg0: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None, None), order='C')], arg1: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None, None), order='C')], arg2: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None), order='C')], arg3: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None, None), order='C')], /) -> Annotated[ArrayLike, dict(dtype='float32', )]: ... + def push_forward(self, arg0: Annotated[ArrayLike, dict(dtype='float32', shape=(None, None, None), order='C', writable=False)], arg1: Annotated[ArrayLike, dict(dtype='float32', shape=(None, None, None), order='C', writable=False)], arg2: Annotated[ArrayLike, dict(dtype='float32', shape=(None), order='C', writable=False)], arg3: Annotated[ArrayLike, dict(dtype='float32', shape=(None, None, None), order='C', writable=False)], /) -> Annotated[ArrayLike, dict(dtype='float32')]: ... - def pull_back(self, arg0: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None, None), order='C')], arg1: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None, None), order='C')], arg2: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None), order='C')], arg3: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None, None), order='C')], /) -> Annotated[ArrayLike, dict(dtype='float32', )]: ... + def pull_back(self, arg0: Annotated[ArrayLike, dict(dtype='float32', shape=(None, None, None), order='C', writable=False)], arg1: Annotated[ArrayLike, dict(dtype='float32', shape=(None, None, None), order='C', writable=False)], arg2: Annotated[ArrayLike, dict(dtype='float32', shape=(None), order='C', writable=False)], arg3: Annotated[ArrayLike, dict(dtype='float32', shape=(None, None, None), order='C', writable=False)], /) -> Annotated[ArrayLike, dict(dtype='float32')]: ... def T_apply(self, arg0: Annotated[ArrayLike, dict(dtype='float32', shape=(None), order='C')], arg1: int, arg2: int, /) -> None: ... @@ -95,7 +95,7 @@ class FiniteElement_float32: def Tt_inv_apply(self, arg0: Annotated[ArrayLike, dict(dtype='float32', shape=(None), order='C')], arg1: int, arg2: int, /) -> None: ... - def base_transformations(self) -> Annotated[ArrayLike, dict(dtype='float32', )]: ... + def base_transformations(self) -> Annotated[ArrayLike, dict(dtype='float32')]: ... def entity_transformations(self) -> dict: ... @@ -165,26 +165,26 @@ class FiniteElement_float32: def sobolev_space(self) -> SobolevSpace: ... @property - def points(self) -> Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None), )]: ... + def points(self) -> Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), writable=False)]: ... @property - def interpolation_matrix(self) -> Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None), )]: ... + def interpolation_matrix(self) -> Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), writable=False)]: ... @property - def dual_matrix(self) -> Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None), )]: ... + def dual_matrix(self) -> Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), writable=False)]: ... @property - def coefficient_matrix(self) -> Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None), )]: + def coefficient_matrix(self) -> Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), writable=False)]: """Coefficient matrix.""" @property - def wcoeffs(self) -> Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None), )]: ... + def wcoeffs(self) -> Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), writable=False)]: ... @property - def M(self) -> list[list[Annotated[ArrayLike, dict(dtype='float32', writable=False, )]]]: ... + def M(self) -> list[list[Annotated[ArrayLike, dict(dtype='float32', writable=False)]]]: ... @property - def x(self) -> list[list[Annotated[ArrayLike, dict(dtype='float32', writable=False, )]]]: ... + def x(self) -> list[list[Annotated[ArrayLike, dict(dtype='float32', writable=False)]]]: ... @property def has_tensor_product_factorisation(self) -> bool: ... @@ -199,19 +199,19 @@ class FiniteElement_float32: def dtype(self) -> str: ... class FiniteElement_float64: - def tabulate(self, arg0: int, arg1: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), order='C')], /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... + def tabulate(self, arg0: int, arg1: Annotated[ArrayLike, dict(dtype='float64', shape=(None, None), order='C', writable=False)], /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... def __eq__(self, arg: object, /) -> bool: ... def hash(self) -> int: ... - def permute_subentity_closure(self, arg0: Annotated[ArrayLike, dict(dtype='int32', shape=(None), order='C')], arg1: int, arg2: CellType, /) -> Annotated[ArrayLike, dict(dtype='int32', )]: ... + def permute_subentity_closure(self, arg0: Annotated[ArrayLike, dict(dtype='int32', shape=(None), order='C')], arg1: int, arg2: CellType, /) -> Annotated[ArrayLike, dict(dtype='int32')]: ... - def permute_subentity_closure_inv(self, arg0: Annotated[ArrayLike, dict(dtype='int32', shape=(None), order='C')], arg1: int, arg2: CellType, /) -> Annotated[ArrayLike, dict(dtype='int32', )]: ... + def permute_subentity_closure_inv(self, arg0: Annotated[ArrayLike, dict(dtype='int32', shape=(None), order='C')], arg1: int, arg2: CellType, /) -> Annotated[ArrayLike, dict(dtype='int32')]: ... - def push_forward(self, arg0: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None, None), order='C')], arg1: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None, None), order='C')], arg2: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None), order='C')], arg3: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None, None), order='C')], /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... + def push_forward(self, arg0: Annotated[ArrayLike, dict(dtype='float64', shape=(None, None, None), order='C', writable=False)], arg1: Annotated[ArrayLike, dict(dtype='float64', shape=(None, None, None), order='C', writable=False)], arg2: Annotated[ArrayLike, dict(dtype='float64', shape=(None), order='C', writable=False)], arg3: Annotated[ArrayLike, dict(dtype='float64', shape=(None, None, None), order='C', writable=False)], /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... - def pull_back(self, arg0: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None, None), order='C')], arg1: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None, None), order='C')], arg2: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None), order='C')], arg3: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None, None), order='C')], /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... + def pull_back(self, arg0: Annotated[ArrayLike, dict(dtype='float64', shape=(None, None, None), order='C', writable=False)], arg1: Annotated[ArrayLike, dict(dtype='float64', shape=(None, None, None), order='C', writable=False)], arg2: Annotated[ArrayLike, dict(dtype='float64', shape=(None), order='C', writable=False)], arg3: Annotated[ArrayLike, dict(dtype='float64', shape=(None, None, None), order='C', writable=False)], /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... def T_apply(self, arg0: Annotated[ArrayLike, dict(dtype='float64', shape=(None), order='C')], arg1: int, arg2: int, /) -> None: ... @@ -219,7 +219,7 @@ class FiniteElement_float64: def Tt_inv_apply(self, arg0: Annotated[ArrayLike, dict(dtype='float64', shape=(None), order='C')], arg1: int, arg2: int, /) -> None: ... - def base_transformations(self) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... + def base_transformations(self) -> Annotated[ArrayLike, dict(dtype='float64')]: ... def entity_transformations(self) -> dict: ... @@ -289,26 +289,26 @@ class FiniteElement_float64: def sobolev_space(self) -> SobolevSpace: ... @property - def points(self) -> Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), )]: ... + def points(self) -> Annotated[ArrayLike, dict(dtype='float64', shape=(None, None), writable=False)]: ... @property - def interpolation_matrix(self) -> Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), )]: ... + def interpolation_matrix(self) -> Annotated[ArrayLike, dict(dtype='float64', shape=(None, None), writable=False)]: ... @property - def dual_matrix(self) -> Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), )]: ... + def dual_matrix(self) -> Annotated[ArrayLike, dict(dtype='float64', shape=(None, None), writable=False)]: ... @property - def coefficient_matrix(self) -> Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), )]: + def coefficient_matrix(self) -> Annotated[ArrayLike, dict(dtype='float64', shape=(None, None), writable=False)]: """Coefficient matrix.""" @property - def wcoeffs(self) -> Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), )]: ... + def wcoeffs(self) -> Annotated[ArrayLike, dict(dtype='float64', shape=(None, None), writable=False)]: ... @property - def M(self) -> list[list[Annotated[ArrayLike, dict(dtype='float64', writable=False, )]]]: ... + def M(self) -> list[list[Annotated[ArrayLike, dict(dtype='float64', writable=False)]]]: ... @property - def x(self) -> list[list[Annotated[ArrayLike, dict(dtype='float64', writable=False, )]]]: ... + def x(self) -> list[list[Annotated[ArrayLike, dict(dtype='float64', writable=False)]]]: ... @property def has_tensor_product_factorisation(self) -> bool: ... @@ -434,35 +434,37 @@ class SobolevSpace(enum.IntEnum): HDivDiv = 13 -def cell_facet_jacobians(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... +def cell_edge_jacobians(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... -def cell_facet_normals(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... +def cell_facet_jacobians(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... + +def cell_facet_normals(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... def cell_facet_orientations(arg: CellType, /) -> list[int]: ... -def cell_facet_outward_normals(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... +def cell_facet_outward_normals(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... -def cell_facet_reference_volumes(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... +def cell_facet_reference_volumes(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... def cell_volume(arg: CellType, /) -> float: ... @overload -def compute_interpolation_operator(arg0: FiniteElement_float32, arg1: FiniteElement_float32, /) -> Annotated[ArrayLike, dict(dtype='float32', )]: ... +def compute_interpolation_operator(arg0: FiniteElement_float32, arg1: FiniteElement_float32, /) -> Annotated[ArrayLike, dict(dtype='float32')]: ... @overload -def compute_interpolation_operator(arg0: FiniteElement_float64, arg1: FiniteElement_float64, /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... +def compute_interpolation_operator(arg0: FiniteElement_float64, arg1: FiniteElement_float64, /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... -def create_custom_element_float32(cell_type: CellType, value_shape: Sequence[int], wcoeffs: Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None), order='C')], x: Sequence[Sequence[Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None), order='C')]]], M: Sequence[Sequence[Annotated[ArrayLike, dict(dtype='float32', writable=False, shape=(None, None, None, None), order='C')]]], interpolation_nderivs: int, map_type: MapType, sobolev_space: SobolevSpace, discontinuous: bool, embedded_subdegree: int, embedded_superdegree: int, poly_type: PolysetType) -> FiniteElement_float32: ... +def create_custom_element_float32(cell_type: CellType, value_shape: Sequence[int], wcoeffs: Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), order='C', writable=False)], x: Sequence[Sequence[Annotated[ArrayLike, dict(dtype='float32', shape=(None, None), order='C', writable=False)]]], M: Sequence[Sequence[Annotated[ArrayLike, dict(dtype='float32', shape=(None, None, None, None), order='C', writable=False)]]], interpolation_nderivs: int, map_type: MapType, sobolev_space: SobolevSpace, discontinuous: bool, embedded_subdegree: int, embedded_superdegree: int, poly_type: PolysetType) -> FiniteElement_float32: ... -def create_custom_element_float64(cell_type: CellType, value_shape: Sequence[int], wcoeffs: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), order='C')], x: Sequence[Sequence[Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), order='C')]]], M: Sequence[Sequence[Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None, None, None), order='C')]]], interpolation_nderivs: int, map_type: MapType, sobolev_space: SobolevSpace, discontinuous: bool, embedded_subdegree: int, embedded_superdegree: int, poly_type: PolysetType) -> FiniteElement_float64: ... +def create_custom_element_float64(cell_type: CellType, value_shape: Sequence[int], wcoeffs: Annotated[ArrayLike, dict(dtype='float64', shape=(None, None), order='C', writable=False)], x: Sequence[Sequence[Annotated[ArrayLike, dict(dtype='float64', shape=(None, None), order='C', writable=False)]]], M: Sequence[Sequence[Annotated[ArrayLike, dict(dtype='float64', shape=(None, None, None, None), order='C', writable=False)]]], interpolation_nderivs: int, map_type: MapType, sobolev_space: SobolevSpace, discontinuous: bool, embedded_subdegree: int, embedded_superdegree: int, poly_type: PolysetType) -> FiniteElement_float64: ... def create_element(arg0: ElementFamily, arg1: CellType, arg2: int, arg3: LagrangeVariant, arg4: DPCVariant, arg5: bool, arg6: Sequence[int], arg7: str, /) -> FiniteElement_float32 | FiniteElement_float64: ... -def create_lattice(arg0: CellType, arg1: int, arg2: LatticeType, arg3: bool, arg4: LatticeSimplexMethod, /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... +def create_lattice(arg0: CellType, arg1: int, arg2: LatticeType, arg3: bool, arg4: LatticeSimplexMethod, /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... def create_tp_element(arg0: ElementFamily, arg1: CellType, arg2: int, arg3: LagrangeVariant, arg4: DPCVariant, arg5: bool, arg6: str, /) -> FiniteElement_float32 | FiniteElement_float64: ... -def geometry(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... +def geometry(arg: CellType, /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... @overload def index(arg: int, /) -> int: ... @@ -473,7 +475,7 @@ def index(arg0: int, arg1: int, /) -> int: ... @overload def index(arg0: int, arg1: int, arg2: int, /) -> int: ... -def make_quadrature(arg0: QuadratureType, arg1: CellType, arg2: PolysetType, arg3: int, /) -> tuple[Annotated[ArrayLike, dict(dtype='float64', )], Annotated[ArrayLike, dict(dtype='float64', )]]: ... +def make_quadrature(arg0: QuadratureType, arg1: CellType, arg2: PolysetType, arg3: int, /) -> tuple[Annotated[ArrayLike, dict(dtype='float64')], Annotated[ArrayLike, dict(dtype='float64')]]: ... def polynomials_dim(arg0: PolynomialType, arg1: CellType, arg2: int, /) -> int: ... @@ -481,17 +483,17 @@ def restriction(arg0: PolysetType, arg1: CellType, arg2: CellType, /) -> Polyset def sobolev_space_intersection(arg0: SobolevSpace, arg1: SobolevSpace, /) -> SobolevSpace: ... -def subentity_types(arg: CellType, /) -> list[list[CellType]]: ... - def sub_entity_connectivity(arg: CellType, /) -> list[list[list[list[int]]]]: ... -def sub_entity_geometry(arg0: CellType, arg1: int, arg2: int, /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... +def sub_entity_geometry(arg0: CellType, arg1: int, arg2: int, /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... + +def subentity_types(arg: CellType, /) -> list[list[CellType]]: ... def superset(arg0: CellType, arg1: PolysetType, arg2: PolysetType, /) -> PolysetType: ... def tabulate_polynomial_set(celltype: CellType, polytype: PolysetType, d: int, n: int, x: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), order='C')]) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... -def tabulate_polynomials(arg0: PolynomialType, arg1: CellType, arg2: int, arg3: Annotated[ArrayLike, dict(dtype='float64', writable=False, shape=(None, None), order='C')], /) -> Annotated[ArrayLike, dict(dtype='float64', )]: ... +def tabulate_polynomials(arg0: PolynomialType, arg1: CellType, arg2: int, arg3: Annotated[ArrayLike, dict(dtype='float64', shape=(None, None), order='C', writable=False)], /) -> Annotated[ArrayLike, dict(dtype='float64')]: ... def topology(arg: CellType, /) -> list[list[list[int]]]: ... diff --git a/python/wrapper.cpp b/python/wrapper.cpp index 16b8d89b3..c15a95848 100644 --- a/python/wrapper.cpp +++ b/python/wrapper.cpp @@ -510,14 +510,12 @@ NB_MODULE(_basixcpp, m) { return cell::volume(cell_type); }); m.def("cell_facet_normals", [](cell::type cell_type) { return as_nbarrayp(cell::facet_normals(cell_type)); }); - m.def("cell_facet_reference_volumes", - [](cell::type cell_type) { - return as_nbarray(cell::facet_reference_volumes(cell_type)); - }); - m.def("cell_facet_outward_normals", - [](cell::type cell_type) { - return as_nbarrayp(cell::facet_outward_normals(cell_type)); - }); + m.def( + "cell_facet_reference_volumes", [](cell::type cell_type) + { return as_nbarray(cell::facet_reference_volumes(cell_type)); }); + m.def( + "cell_facet_outward_normals", [](cell::type cell_type) + { return as_nbarrayp(cell::facet_outward_normals(cell_type)); }); m.def("cell_facet_orientations", [](cell::type cell_type) {