From 52101003772ece741e114426c12c6ba4407199d5 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:49:07 +0100 Subject: [PATCH 01/15] Add post-install mypy check(s) --- .github/workflows/pythonapp.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index aac0403ee..4b87b3be4 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -152,7 +152,13 @@ jobs: - name: Install Python dependencies run: pip install nanobind scikit-build-core[pyproject] - name: Install Basix - run: pip install --no-build-isolation . + run: pip install --no-build-isolation -e . + - name: Run mypy (module) + run: mypy -p basix + - name: Run mypy (test) + run: mypy test + - name: Run mypy (demo) + run: mypy demo/python build-cmake: name: Build using C++ and Python parts separately and run tests From ca2f162b3151675908132ec8b37d53b15afc13d2 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:51:17 +0100 Subject: [PATCH 02/15] Install mypy --- .github/workflows/pythonapp.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 4b87b3be4..f82f65ad2 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -153,6 +153,8 @@ jobs: run: pip install nanobind scikit-build-core[pyproject] - name: Install Basix run: pip install --no-build-isolation -e . + - name: Install mypy + run: pip install mypy - name: Run mypy (module) run: mypy -p basix - name: Run mypy (test) From 87c237bb6403c5136fa7ac588037f36213440ebd Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:56:02 +0100 Subject: [PATCH 03/15] No demo --- .github/workflows/pythonapp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index f82f65ad2..53018ea07 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -159,8 +159,8 @@ jobs: run: mypy -p basix - name: Run mypy (test) run: mypy test - - name: Run mypy (demo) - run: mypy demo/python + # - name: Run mypy (demo) + # run: mypy demo/python build-cmake: name: Build using C++ and Python parts separately and run tests From d4125a52ff872d6ff7341e23604682d443c7470d Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 11:19:00 +0100 Subject: [PATCH 04/15] Fix all errors except one --- python/basix/finite_element.py | 4 ++-- python/basix/ufl.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/basix/finite_element.py b/python/basix/finite_element.py index c3e4fe7f7..c3783203a 100644 --- a/python/basix/finite_element.py +++ b/python/basix/finite_element.py @@ -548,7 +548,7 @@ def wcoeffs(self) -> npt.ArrayLike: return self._e.wcoeffs @property - def M(self) -> list[list[npt.NDArray]]: + def M(self) -> list[list[typing.Annotated[npt.ArrayLike, dict(writable=False)]]]: """Interpolation matrices for each sub-entity. See C++ documentation for details. @@ -556,7 +556,7 @@ def M(self) -> list[list[npt.NDArray]]: return self._e.M @property - def x(self) -> list[list[npt.NDArray]]: + def x(self) -> list[list[typing.Annotated[npt.ArrayLike, dict(writable=False)]]]: """Interpolation points for each sub-entity. The indices of this data are ``(tdim, entity index, point index, diff --git a/python/basix/ufl.py b/python/basix/ufl.py index 2ba6f599f..4ccaba6ee 100644 --- a/python/basix/ufl.py +++ b/python/basix/ufl.py @@ -358,12 +358,12 @@ def _wcoeffs(self) -> _npt.ArrayLike: raise NotImplementedError() @property - def _x(self) -> list[list[_npt.NDArray]]: + def _x(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: """The points used to define interpolation.""" raise NotImplementedError() @property - def _M(self) -> list[list[_npt.NDArray]]: + def _M(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: """The matrices used to define interpolation.""" raise NotImplementedError() @@ -555,11 +555,11 @@ def _wcoeffs(self) -> _npt.ArrayLike: return self._element.wcoeffs @property - def _x(self) -> list[list[_npt.NDArray]]: + def _x(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: return self._element.x @property - def _M(self) -> list[list[_npt.NDArray]]: + def _M(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: return self._element.M @property @@ -1182,11 +1182,11 @@ def _wcoeffs(self) -> _npt.ArrayLike: return wcoeffs @property - def _x(self) -> list[list[_npt.NDArray]]: + def _x(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: return self._sub_element._x @property - def _M(self) -> list[list[_npt.NDArray]]: + def _M(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: M = [] for M_list in self._sub_element._M: M_row = [] From d75a8615d2f33d126f94f056e97481b36c7fe32a Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 11:19:58 +0100 Subject: [PATCH 05/15] Get that error triggering in CI --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 53018ea07..b0db1a7e1 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -152,7 +152,7 @@ jobs: - name: Install Python dependencies run: pip install nanobind scikit-build-core[pyproject] - name: Install Basix - run: pip install --no-build-isolation -e . + run: pip install --no-build-isolation . - name: Install mypy run: pip install mypy - name: Run mypy (module) From 418acc6c7a4684697236216ac8232975000346fa Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 11:26:35 +0100 Subject: [PATCH 06/15] Backout --- python/basix/finite_element.py | 4 ++-- python/basix/ufl.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/basix/finite_element.py b/python/basix/finite_element.py index c3783203a..c3e4fe7f7 100644 --- a/python/basix/finite_element.py +++ b/python/basix/finite_element.py @@ -548,7 +548,7 @@ def wcoeffs(self) -> npt.ArrayLike: return self._e.wcoeffs @property - def M(self) -> list[list[typing.Annotated[npt.ArrayLike, dict(writable=False)]]]: + def M(self) -> list[list[npt.NDArray]]: """Interpolation matrices for each sub-entity. See C++ documentation for details. @@ -556,7 +556,7 @@ def M(self) -> list[list[typing.Annotated[npt.ArrayLike, dict(writable=False)]]] return self._e.M @property - def x(self) -> list[list[typing.Annotated[npt.ArrayLike, dict(writable=False)]]]: + def x(self) -> list[list[npt.NDArray]]: """Interpolation points for each sub-entity. The indices of this data are ``(tdim, entity index, point index, diff --git a/python/basix/ufl.py b/python/basix/ufl.py index 4ccaba6ee..2ba6f599f 100644 --- a/python/basix/ufl.py +++ b/python/basix/ufl.py @@ -358,12 +358,12 @@ def _wcoeffs(self) -> _npt.ArrayLike: raise NotImplementedError() @property - def _x(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: + def _x(self) -> list[list[_npt.NDArray]]: """The points used to define interpolation.""" raise NotImplementedError() @property - def _M(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: + def _M(self) -> list[list[_npt.NDArray]]: """The matrices used to define interpolation.""" raise NotImplementedError() @@ -555,11 +555,11 @@ def _wcoeffs(self) -> _npt.ArrayLike: return self._element.wcoeffs @property - def _x(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: + def _x(self) -> list[list[_npt.NDArray]]: return self._element.x @property - def _M(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: + def _M(self) -> list[list[_npt.NDArray]]: return self._element.M @property @@ -1182,11 +1182,11 @@ def _wcoeffs(self) -> _npt.ArrayLike: return wcoeffs @property - def _x(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: + def _x(self) -> list[list[_npt.NDArray]]: return self._sub_element._x @property - def _M(self) -> list[list[_typing.Annotated[_npt.ArrayLike, dict(writable=False)]]]: + def _M(self) -> list[list[_npt.NDArray]]: M = [] for M_list in self._sub_element._M: M_row = [] From 81b322e6ccee43f64f64f51185db7039888b03d8 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 11:39:57 +0100 Subject: [PATCH 07/15] Remove INSTALL_TIME, not needed. --- python/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 8a946a2e3..d37587b3b 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -112,15 +112,15 @@ else() set_target_properties(_basixcpp PROPERTIES INSTALL_RPATH ${_basix_dir}) endif() -install(TARGETS _basixcpp LIBRARY DESTINATION basix) - # and the nanobind typing stubs. nanobind_add_stub( _basixcpp_stub MODULE basix._basixcpp DEPENDS _basixcpp VERBOSE - INSTALL_TIME OUTPUT - basix/_basixcpp.pyi + _basixcpp.pyi ) + +install(TARGETS _basixcpp LIBRARY DESTINATION basix) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_basixcpp.pyi DESTINATION basix) From 51ce838bc7cf5d87013b04343eaf1071b8e253df Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 11:41:28 +0100 Subject: [PATCH 08/15] Apply pattern file - doesn't match, but at least it applies. --- python/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index d37587b3b..6134905cb 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -117,6 +117,7 @@ nanobind_add_stub( _basixcpp_stub MODULE basix._basixcpp DEPENDS _basixcpp + PATTERN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/pattern_stub.txt VERBOSE OUTPUT _basixcpp.pyi From 78f5bbdead9b3c91d40b136fd530b10111a160a3 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 11:48:41 +0100 Subject: [PATCH 09/15] Fix isolated install --- pyproject.toml | 2 +- python/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ae09da0aa..cf48e48fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["scikit-build-core[pyproject]>=0.10.0", "nanobind>=2.5.0"] +requires = ["scikit-build-core[pyproject]>=0.10.0", "nanobind>=2.5.0", "numpy"] build-backend = "scikit_build_core.build" [project] diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 6134905cb..5030e0ade 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -115,7 +115,8 @@ endif() # and the nanobind typing stubs. nanobind_add_stub( _basixcpp_stub - MODULE basix._basixcpp + MODULE _basixcpp + PYTHON_PATH $ DEPENDS _basixcpp PATTERN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/pattern_stub.txt VERBOSE From 3ae73cf458f5ccaa8163302483fab8aa2e0de17c Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 11:49:16 +0100 Subject: [PATCH 10/15] numpy not needed --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cf48e48fe..ae09da0aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["scikit-build-core[pyproject]>=0.10.0", "nanobind>=2.5.0", "numpy"] +requires = ["scikit-build-core[pyproject]>=0.10.0", "nanobind>=2.5.0"] build-backend = "scikit_build_core.build" [project] From e3ab5cd64afa1ba6cec33b35ea9d026625567647 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 12:12:46 +0100 Subject: [PATCH 11/15] Windows 'static linking' requires INSTALL_TIME --- python/CMakeLists.txt | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 5030e0ade..8d351411b 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -7,7 +7,7 @@ endif() project(basix_nanobind VERSION "0.9.0.0" LANGUAGES CXX) -if (WIN32) +if(WIN32) # Windows requires all symbols to be manually exported. # This flag exports all symbols automatically, as in Unix. set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) @@ -113,16 +113,30 @@ else() endif() # and the nanobind typing stubs. -nanobind_add_stub( - _basixcpp_stub - MODULE _basixcpp - PYTHON_PATH $ - DEPENDS _basixcpp - PATTERN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/pattern_stub.txt - VERBOSE - OUTPUT - _basixcpp.pyi -) - -install(TARGETS _basixcpp LIBRARY DESTINATION basix) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_basixcpp.pyi DESTINATION basix) +if (WIN32) + install(TARGETS _basixcpp LIBRARY DESTINATION basix) + nanobind_add_stub( + _basixcpp_stub + MODULE basix._basixcpp + DEPENDS _basixcpp + INSTALL_TIME + PATTERN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/pattern_stub.txt + VERBOSE + OUTPUT + basix/_basixcpp.pyi + ) +else() + nanobind_add_stub( + _basixcpp_stub + MODULE _basixcpp + PYTHON_PATH $ + DEPENDS _basixcpp + PATTERN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/pattern_stub.txt + VERBOSE + OUTPUT + _basixcpp.pyi + ) + + install(TARGETS _basixcpp LIBRARY DESTINATION basix) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_basixcpp.pyi DESTINATION basix) +endif() From f43ae2192812955bf055d8b7622dc5c1e3fb43cc Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 14:16:28 +0100 Subject: [PATCH 12/15] Comments - it's a bit complicated! --- python/CMakeLists.txt | 18 ++++++++++++++++-- python/basix/py.typed | 0 2 files changed, 16 insertions(+), 2 deletions(-) delete mode 100644 python/basix/py.typed diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 8d351411b..54f5600d1 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -114,29 +114,43 @@ endif() # and the nanobind typing stubs. if (WIN32) + # On Windows we cannot import basix._basixcpp without installing the package + # alongside its external dlls. + + # This *must* be called prior to nanobind_add_stub install(TARGETS _basixcpp LIBRARY DESTINATION basix) + # nanobind automatically installs into ${CMAKE_INSTALL_PREFIX} in + # INSTALL_TIME mode. + # DEPENDS is redundant in INSTALL_TIME mode - _basixcpp must be installed. nanobind_add_stub( _basixcpp_stub MODULE basix._basixcpp - DEPENDS _basixcpp INSTALL_TIME PATTERN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/pattern_stub.txt + MARKER_FILE basix/py.typed VERBOSE OUTPUT basix/_basixcpp.pyi ) else() + # On UNIX-like systems we can import the cpp compiled module before + # installing and rely on dynamic linking at import time. nanobind_add_stub( _basixcpp_stub MODULE _basixcpp PYTHON_PATH $ DEPENDS _basixcpp PATTERN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/pattern_stub.txt + MARKER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/basix/py.typed VERBOSE OUTPUT _basixcpp.pyi ) install(TARGETS _basixcpp LIBRARY DESTINATION basix) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/_basixcpp.pyi DESTINATION basix) + install(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/basix/py.typed + ${CMAKE_CURRENT_BINARY_DIR}/_basixcpp.pyi + DESTINATION basix + ) endif() diff --git a/python/basix/py.typed b/python/basix/py.typed deleted file mode 100644 index e69de29bb..000000000 From fc1de2f3658da65dbd5b61cde876f5e98eb14a55 Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 15:21:00 +0100 Subject: [PATCH 13/15] Remove trivial return types --- python/pattern_stub.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/python/pattern_stub.txt b/python/pattern_stub.txt index 24d5707f6..10c317831 100644 --- a/python/pattern_stub.txt +++ b/python/pattern_stub.txt @@ -1,2 +1,7 @@ -basix._basixcpp.tabulate_polynomial_set: - 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', )]: ... \ No newline at end of file +tabulate_polynomial_set: + \from typing import TypeVar + \from numpy.typing import NDArray as _NDArray + \from numpy import float32 as _f32, float64 as _f64 + _polynomial_set_floats = TypeVar("_polynomial_set_floats", _f32, _f64) + + def tabulate_polynomial_set(celltype: CellType, polytype: PolysetType, d: int, n: int, x: _NDArray[_polynomial_set_floats],) -> _NDArray[_polynomial_set_floats]: ... From 54d852e7cdedffbebbe3ef2f002080721417d89a Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 15:34:53 +0100 Subject: [PATCH 14/15] Fix typing --- python/basix/finite_element.py | 4 ++-- python/basix/ufl.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/basix/finite_element.py b/python/basix/finite_element.py index c3e4fe7f7..a088d2749 100644 --- a/python/basix/finite_element.py +++ b/python/basix/finite_element.py @@ -548,7 +548,7 @@ def wcoeffs(self) -> npt.ArrayLike: return self._e.wcoeffs @property - def M(self) -> list[list[npt.NDArray]]: + def M(self) -> list[list[npt.ArrayLike]]: """Interpolation matrices for each sub-entity. See C++ documentation for details. @@ -556,7 +556,7 @@ def M(self) -> list[list[npt.NDArray]]: return self._e.M @property - def x(self) -> list[list[npt.NDArray]]: + def x(self) -> list[list[npt.ArrayLike]]: """Interpolation points for each sub-entity. The indices of this data are ``(tdim, entity index, point index, diff --git a/python/basix/ufl.py b/python/basix/ufl.py index 2ba6f599f..998d157cc 100644 --- a/python/basix/ufl.py +++ b/python/basix/ufl.py @@ -358,12 +358,12 @@ def _wcoeffs(self) -> _npt.ArrayLike: raise NotImplementedError() @property - def _x(self) -> list[list[_npt.NDArray]]: + def _x(self) -> list[list[_npt.ArrayLike]]: """The points used to define interpolation.""" raise NotImplementedError() @property - def _M(self) -> list[list[_npt.NDArray]]: + def _M(self) -> list[list[_npt.ArrayLike]]: """The matrices used to define interpolation.""" raise NotImplementedError() @@ -555,11 +555,11 @@ def _wcoeffs(self) -> _npt.ArrayLike: return self._element.wcoeffs @property - def _x(self) -> list[list[_npt.NDArray]]: + def _x(self) -> list[list[_npt.ArrayLike]]: return self._element.x @property - def _M(self) -> list[list[_npt.NDArray]]: + def _M(self) -> list[list[_npt.ArrayLike]]: return self._element.M @property @@ -1182,11 +1182,11 @@ def _wcoeffs(self) -> _npt.ArrayLike: return wcoeffs @property - def _x(self) -> list[list[_npt.NDArray]]: + def _x(self) -> list[list[_npt.ArrayLike]]: return self._sub_element._x @property - def _M(self) -> list[list[_npt.NDArray]]: + def _M(self) -> list[list[_npt.ArrayLike]]: M = [] for M_list in self._sub_element._M: M_row = [] From ce8313cc6ed673af5170839702bf29dafe9166ea Mon Sep 17 00:00:00 2001 From: "Jack S. Hale" Date: Wed, 25 Feb 2026 15:45:56 +0100 Subject: [PATCH 15/15] Revert - mysterious how it works in CI and not locally --- python/basix/finite_element.py | 4 ++-- python/basix/ufl.py | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/python/basix/finite_element.py b/python/basix/finite_element.py index a088d2749..c3e4fe7f7 100644 --- a/python/basix/finite_element.py +++ b/python/basix/finite_element.py @@ -548,7 +548,7 @@ def wcoeffs(self) -> npt.ArrayLike: return self._e.wcoeffs @property - def M(self) -> list[list[npt.ArrayLike]]: + def M(self) -> list[list[npt.NDArray]]: """Interpolation matrices for each sub-entity. See C++ documentation for details. @@ -556,7 +556,7 @@ def M(self) -> list[list[npt.ArrayLike]]: return self._e.M @property - def x(self) -> list[list[npt.ArrayLike]]: + def x(self) -> list[list[npt.NDArray]]: """Interpolation points for each sub-entity. The indices of this data are ``(tdim, entity index, point index, diff --git a/python/basix/ufl.py b/python/basix/ufl.py index 998d157cc..2ba6f599f 100644 --- a/python/basix/ufl.py +++ b/python/basix/ufl.py @@ -358,12 +358,12 @@ def _wcoeffs(self) -> _npt.ArrayLike: raise NotImplementedError() @property - def _x(self) -> list[list[_npt.ArrayLike]]: + def _x(self) -> list[list[_npt.NDArray]]: """The points used to define interpolation.""" raise NotImplementedError() @property - def _M(self) -> list[list[_npt.ArrayLike]]: + def _M(self) -> list[list[_npt.NDArray]]: """The matrices used to define interpolation.""" raise NotImplementedError() @@ -555,11 +555,11 @@ def _wcoeffs(self) -> _npt.ArrayLike: return self._element.wcoeffs @property - def _x(self) -> list[list[_npt.ArrayLike]]: + def _x(self) -> list[list[_npt.NDArray]]: return self._element.x @property - def _M(self) -> list[list[_npt.ArrayLike]]: + def _M(self) -> list[list[_npt.NDArray]]: return self._element.M @property @@ -1182,11 +1182,11 @@ def _wcoeffs(self) -> _npt.ArrayLike: return wcoeffs @property - def _x(self) -> list[list[_npt.ArrayLike]]: + def _x(self) -> list[list[_npt.NDArray]]: return self._sub_element._x @property - def _M(self) -> list[list[_npt.ArrayLike]]: + def _M(self) -> list[list[_npt.NDArray]]: M = [] for M_list in self._sub_element._M: M_row = []