Skip to content

Comments

Try fix#991

Merged
jhale merged 5 commits intojhale/generate-nanobind-filefrom
schnellerhase/try-nanobind
Feb 23, 2026
Merged

Try fix#991
jhale merged 5 commits intojhale/generate-nanobind-filefrom
schnellerhase/try-nanobind

Conversation

@schnellerhase
Copy link
Contributor

@schnellerhase schnellerhase commented Feb 18, 2026

Builds on top of FEniCS/dolfinx#4096 - powered by @qbisi.

Co-authored-by: qbisicwate <qbisicwate@gmail.com>
@schnellerhase schnellerhase requested a review from qbisi February 19, 2026 06:59
@qbisi
Copy link
Contributor

qbisi commented Feb 19, 2026

Generated _basixcpp.pyi compared to preset one

diff --git a/python/basix/_basixcpp.pyi b/python/basix/_basixcpp.pyi
index 0eb1604..5376036 100644
--- a/python/basix/_basixcpp.pyi
+++ b/python/basix/_basixcpp.pyi
@@ -1,9 +1,11 @@
+"""Interface to the Basix C++ library."""
+
 from collections.abc import Sequence
 import enum
 from typing import Annotated, overload
 
 import numpy
-from numpy.typing import NDArray, ArrayLike
+from numpy.typing import NDArray
 
 
 def topology(arg: CellType, /) -> list[list[list[int]]]: ...
@@ -220,9 +222,9 @@ def create_element(arg0: ElementFamily, arg1: CellType, arg2: int, arg3: Lagrang
 
 def create_tp_element(arg0: ElementFamily, arg1: CellType, arg2: int, arg3: LagrangeVariant, arg4: DPCVariant, arg5: bool, arg6: str, /) -> FiniteElement_float32 | FiniteElement_float64: ...
 
-def tp_factors(arg0: ElementFamily, arg1: CellType, arg2: int, arg3: LagrangeVariant, arg4: DPCVariant, arg5: bool, arg6: Sequence[int], arg7: str, /) -> list[list[FiniteElement_float32]] | list[list[FiniteElement_float64]]: ...
+def tp_factors(arg0: ElementFamily, arg1: CellType, arg2: int, arg3: LagrangeVariant, arg4: DPCVariant, arg5: bool, arg6: Sequence[int], arg7: str, /) -> list[list[FiniteElement_float32]] | list[list[FiniteElement_float64]] | None: ...
 
-def tp_dof_ordering(arg0: ElementFamily, arg1: CellType, arg2: int, arg3: LagrangeVariant, arg4: DPCVariant, arg5: bool, /) -> list[int]: ...
+def tp_dof_ordering(arg0: ElementFamily, arg1: CellType, arg2: int, arg3: LagrangeVariant, arg4: DPCVariant, arg5: bool, /) -> list[int] | None: ...
 
 def lex_dof_ordering(arg0: ElementFamily, arg1: CellType, arg2: int, arg3: LagrangeVariant, arg4: DPCVariant, arg5: bool, /) -> list[int]: ...
 
@@ -390,7 +392,11 @@ def compute_interpolation_operator(arg0: FiniteElement_float32, arg1: FiniteElem
 @overload
 def compute_interpolation_operator(arg0: FiniteElement_float64, arg1: FiniteElement_float64, /) -> NDArray[numpy.float64]: ...
 
-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', )]: ...
+@overload
+def tabulate_polynomial_set(celltype: CellType, polytype: PolysetType, d: int, n: int, x: Annotated[NDArray[numpy.float32], dict(shape=(None, None), order='C', writable=False)]) -> NDArray[numpy.float32]: ...
+
+@overload
+def tabulate_polynomial_set(celltype: CellType, polytype: PolysetType, d: int, n: int, x: Annotated[NDArray[numpy.float64], dict(shape=(None, None), order='C', writable=False)]) -> NDArray[numpy.float64]: ...
 
 class FiniteElement_float64:
     def tabulate(self, arg0: int, arg1: Annotated[NDArray[numpy.float64], dict(shape=(None, None), order='C', writable=False)], /) -> NDArray[numpy.float64]: ...

@schnellerhase
Copy link
Contributor Author

Looks good, optional correctly adapts to #919 - where I did not update the stubs.

@jhale
Copy link
Member

jhale commented Feb 20, 2026

Can you back out the changes to the CI? Not related to the PR.

@jhale jhale merged commit 3fa9a40 into jhale/generate-nanobind-file Feb 23, 2026
10 checks passed
@jhale jhale deleted the schnellerhase/try-nanobind branch February 23, 2026 09:08
github-merge-queue bot pushed a commit that referenced this pull request Feb 23, 2026
* Try building pyi file.

* Try this for Windows.

* Use nuget vcpkg cache.

* Fix.

* Update python/CMakeLists.txt

Co-authored-by: Paul T. Kühner <56360279+schnellerhase@users.noreply.github.com>

* Revert "Update python/CMakeLists.txt"

This reverts commit bf678a6.

* Try fix (#991)

* Try fix

* Silvence for now

* Update python/CMakeLists.txt

Co-authored-by: qbisicwate <qbisicwate@gmail.com>

* Run all PR CI independent of target branch

* Revert "Run all PR CI independent of target branch"

This reverts commit c885745.

---------

Co-authored-by: qbisicwate <qbisicwate@gmail.com>

---------

Co-authored-by: Paul T. Kühner <56360279+schnellerhase@users.noreply.github.com>
Co-authored-by: qbisicwate <qbisicwate@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants