Conversation
- ufl.py: annotate get_tensor_product_representation's base return type so real overrides stop tripping bad-override; fix a stray loop variable used after its loop in create_enriched_element. - test_continuity.py: facets lists mixed ndarray/dict rows as plain lists, unioning every unpacked variable's type; switch to tuples. - test_bernstein.py, test_mappings.py (x2), test_interpolation_between_elements.py: non-exhaustive if/elif chains left a variable possibly unbound; add an else raise. - test_tensor_products.py: the assert comparing values1/values2 sat after its loop instead of inside it, so only the last tensor factor was ever checked (and values2 was unbound if factors was empty); move the assert into the loop. - test_version.py: import basix._basixcpp directly so it's a statically visible attribute. The 7 remaining baselined diagnostics are matplotlib/sympy stub artifacts unrelated to Basix's own code. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DufZTv24tYPshRaUq1UBKW
jhale
added this pull request to stack #1070
September 14, 2026 14:19
jhale
marked this pull request as ready for review
September 14, 2026 14:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1068. Fixes the real bugs Pyrefly surfaced there, shrinking the baseline from 22 to 7.
ufl.py: annotateget_tensor_product_representation's base return type (was inferred-> None, tripping a falsebad-overrideon every real subclass); fix a loop variable (e) used after itsforloop increate_enriched_element, which was unbound whenevermap_typewas already given.test_continuity.py:facetsrows mixedndarrayanddictas plainlists, so unpacking unioned every variable's type across the row — switched to tuples.test_bernstein.py,test_mappings.py(×2),test_interpolation_between_elements.py: non-exhaustiveif/elifchains left a variable possibly unbound; added anelse: raise NotImplementedError.test_tensor_products.py: the assertion comparingvalues1/values2sat after itsfor fs in factorsloop instead of inside it, so only the last tensor factor was ever checked; moved it in — also unbound iffactorswas ever empty.test_version.py:import basix._basixcppdirectly so it's a statically visible attribute.The 7 remaining baselined diagnostics are matplotlib/sympy stub artifacts unrelated to Basix's own code (per Pyrefly,
mplot3d'sAxesreturn can beNone; sympy's third-party stubs don't modelSymbolarithmetic against numpy arrays).Verified:
pyrefly check --error-stale-baseline→ 0 errors; ruff clean; full pytest coverage for every touched test file plustest_ufl_wrapper.pypasses (957 passed, 0 failed).