Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 0 additions & 105 deletions pyrefly-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,97 +28,6 @@
"concise_description": "Object of class `NoneType` has no attribute `scatter`",
"severity": "error"
},
{
"column": 9,
"path": "python/basix/ufl.py",
"name": "bad-override",
"concise_description": "Class member `_BasixElement.get_tensor_product_representation` overrides parent class `_ElementBase` in an inconsistent manner",
"severity": "error"
},
{
"column": 13,
"path": "python/basix/ufl.py",
"name": "unbound-name",
"concise_description": "`e` may be uninitialized",
"severity": "error"
},
{
"column": 14,
"path": "test/test_bernstein.py",
"name": "unbound-name",
"concise_description": "`derivs` may be uninitialized",
"severity": "error"
},
{
"column": 46,
"path": "test/test_continuity.py",
"name": "unsupported-operation",
"concise_description": "`-` is not supported between `dict[Unknown, int]` and `dict[Unknown, int]`",
"severity": "error"
},
{
"column": 29,
"path": "test/test_continuity.py",
"name": "unsupported-operation",
"concise_description": "`-` is not supported between `dict[Unknown, int]` and `dict[Unknown, int]`",
"severity": "error"
},
{
"column": 50,
"path": "test/test_continuity.py",
"name": "unsupported-operation",
"concise_description": "`-` is not supported between `dict[Unknown, int]` and `dict[Unknown, int]`",
"severity": "error"
},
{
"column": 28,
"path": "test/test_continuity.py",
"name": "unsupported-operation",
"concise_description": "`+` is not supported between `dict[Unknown, int]` and `dict[Unknown, int]`",
"severity": "error"
},
{
"column": 37,
"path": "test/test_continuity.py",
"name": "unsupported-operation",
"concise_description": "`+` is not supported between `dict[Unknown, int]` and `dict[Unknown, int]`",
"severity": "error"
},
{
"column": 29,
"path": "test/test_continuity.py",
"name": "unsupported-operation",
"concise_description": "`-` is not supported between `dict[Unknown, int]` and `dict[Unknown, int]`",
"severity": "error"
},
{
"column": 50,
"path": "test/test_continuity.py",
"name": "unsupported-operation",
"concise_description": "`-` is not supported between `dict[Unknown, int]` and `dict[Unknown, int]`",
"severity": "error"
},
{
"column": 44,
"path": "test/test_interpolation_between_elements.py",
"name": "unbound-name",
"concise_description": "`p_family` may be uninitialized",
"severity": "error"
},
{
"column": 28,
"path": "test/test_mappings.py",
"name": "unbound-name",
"concise_description": "`points` may be uninitialized",
"severity": "error"
},
{
"column": 47,
"path": "test/test_mappings.py",
"name": "unbound-name",
"concise_description": "`physical_vs` may be uninitialized",
"severity": "error"
},
{
"column": 32,
"path": "test/test_polynomials.py",
Expand All @@ -139,20 +48,6 @@
"name": "bad-argument-type",
"concise_description": "Argument `Buffer | _NestedSequence[bytes | complex | str] | _NestedSequence[_SupportsArray[dtype]] | _SupportsArray[dtype] | bytes | complex | str` is not assignable to parameter `iter2` with type `Iterable[@_]` in function `zip.__new__`",
"severity": "error"
},
{
"column": 41,
"path": "test/test_tensor_products.py",
"name": "unbound-name",
"concise_description": "`values2` may be uninitialized",
"severity": "error"
},
{
"column": 64,
"path": "test/test_version.py",
"name": "missing-attribute",
"concise_description": "No attribute `_basixcpp` in module `basix`",
"severity": "error"
}
]
}
6 changes: 4 additions & 2 deletions python/basix/ufl.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,9 @@ def basix_sobolev_space(self) -> _basix.SobolevSpace:
def dtype(self) -> _npt.DTypeLike:
"""Element float type."""

def get_tensor_product_representation(self):
def get_tensor_product_representation(
self,
) -> list[list[_basix.finite_element.FiniteElement]] | None:
"""Get the element's tensor product factorisation."""
return None

Expand Down Expand Up @@ -1687,7 +1689,7 @@ def enriched_element(
if e.map_type != map_type:
raise ValueError("Enriched elements on different map types not supported.")

dtype = e.dtype
dtype = elements[0].dtype
hcd = min(e.embedded_subdegree for e in elements)
hd = max(e.embedded_superdegree for e in elements)
ss = _basix.sobolev_spaces.intersection([e.basix_sobolev_space for e in elements])
Expand Down
2 changes: 2 additions & 0 deletions test/test_bernstein.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ def test_element(celltype, degree):
derivs = [(0,), (1,), (2,), (3,)]
elif celltype == basix.CellType.triangle:
derivs = [(n - i, i) for n in range(4) for i in range(n + 1)]
else:
raise NotImplementedError

for k in derivs:
wsym = np.zeros_like(wtab[0])
Expand Down
32 changes: 16 additions & 16 deletions test/test_continuity.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ def test_continuity_interval_facet(degree, element, variant):
pytest.skip()

facets = [
[
(
np.array([0, 0]),
np.array([1, 0]),
{basix.CellType.triangle: 2, basix.CellType.quadrilateral: 0},
],
[
),
(
np.array([0, 0]),
np.array([0, 1]),
{basix.CellType.triangle: 1, basix.CellType.quadrilateral: 1},
],
),
]

for start, end, cellmap in facets:
Expand Down Expand Up @@ -112,24 +112,24 @@ def test_continuity_triangle_facet(degree, element, variant):
pytest.skip()

facets = [
[
(
np.array([0, 0, 0]),
np.array([1, 0, 0]),
np.array([0, 1, 0]),
{basix.CellType.tetrahedron: 3, basix.CellType.prism: 0},
],
[
),
(
np.array([0, 0, 0]),
np.array([1, 0, 0]),
np.array([0, 0, 1]),
{basix.CellType.tetrahedron: 2, basix.CellType.pyramid: 1},
],
[
),
(
np.array([0, 0, 0]),
np.array([0, 1, 0]),
np.array([0, 0, 1]),
{basix.CellType.tetrahedron: 1, basix.CellType.pyramid: 2},
],
),
]

for v0, v1, v2, cellmap in facets:
Expand Down Expand Up @@ -164,27 +164,27 @@ def test_continuity_quadrilateral_facet(degree, element, variant):
pytest.skip()

facets = [
[
(
np.array([0, 0, 0]),
np.array([1, 0, 0]),
np.array([0, 1, 0]),
np.array([1, 1, 0]),
{basix.CellType.hexahedron: 0, basix.CellType.pyramid: 0},
],
[
),
(
np.array([0, 0, 0]),
np.array([1, 0, 0]),
np.array([0, 0, 1]),
np.array([1, 0, 1]),
{basix.CellType.hexahedron: 1, basix.CellType.prism: 1},
],
[
),
(
np.array([0, 0, 0]),
np.array([0, 1, 0]),
np.array([0, 0, 1]),
np.array([0, 1, 1]),
{basix.CellType.hexahedron: 2, basix.CellType.prism: 2},
],
),
]

for v0, v1, v2, v3, cellmap in facets:
Expand Down
2 changes: 2 additions & 0 deletions test/test_interpolation_between_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ def test_degree_bounds(cell_type, degree, element_type, element_args):
p_family = basix.ElementFamily.P
elif element.polyset_type == basix.PolysetType.macroedge:
p_family = basix.ElementFamily.iso
else:
raise NotImplementedError

if element.embedded_superdegree >= 0:
# The element being tested should be a subset of this Lagrange space
Expand Down
4 changes: 4 additions & 0 deletions test/test_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def run_map_test(e, J, detJ, K, reference_value_size, physical_value_size):
for k in range(N + 1 - i - j)
]
)
else:
raise NotImplementedError
values = e.tabulate(0, points)[0]

_J = np.array([J for p in points])
Expand Down Expand Up @@ -78,6 +80,8 @@ def test_mappings_2d_to_3d(element_type, element_args):
physical_vs = 3
elif e.value_size == 4:
physical_vs = 9
else:
raise NotImplementedError
run_map_test(e, J, detJ, K, e.value_size, physical_vs)


Expand Down
2 changes: 1 addition & 1 deletion test/test_tensor_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_tensor_product_factorisation(cell_type, degree, element_type, element_a
e.tabulate(d, p.reshape(1, -1))[d, 0, :, 0] for e, p, d in zip(fs, point, ds)
]
values2 = tensor_product(*evals)
assert np.allclose(values1, values2)
assert np.allclose(values1, values2)


@pytest.mark.parametrize("degree", range(1, 9))
Expand Down
1 change: 1 addition & 0 deletions test/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest

import basix
import basix._basixcpp


def is_canonical(version):
Expand Down
Loading