test(lt): add regression tests for lt.matrix() on oblique/non-Euclidean metrics (#461)#558
Merged
utensil merged 2 commits intopygae:masterfrom Apr 1, 2026
Conversation
…an metrics (pygae#461) Adds two tests to confirm the bugs reported in pygae#461 are fixed: - test_lt_matrix_oblique: lt.matrix() on oblique g=[[1,1],[1,2]] and Minkowski g=diag(1,-1) returns the bare coefficient matrix without metric tensor factors - test_lt_generic_oblique: Ga.lt('f') on oblique metric produces f(e_j) with plain symbol coefficients and a matching matrix()
utensil
requested changes
Apr 1, 2026
Member
utensil
left a comment
There was a problem hiding this comment.
Thanks for adding these.
The two test cases pin exactly what GSG reported — isinstance(s, Symbol) is the right check for metric contamination, and the oblique + Minkowski cases cover what the existing test missed.
One fix: from sympy import Symbol is inside test_lt_generic_oblique. Move it to the top-level import line (from sympy import symbols, S, Matrix, Symbol).
utiberious
added a commit
to utiberious/galgebra
that referenced
this pull request
Apr 1, 2026
Groups new entries by: features, bug fixes, examples/docs, tests/maintenance. Features: Cl() kingdon interface (pygae#550, closes pygae#524), Mv.__rtruediv__ (pygae#543, closes pygae#512), shirokov_inverse/hitzer_inverse (pygae#530). Bugs: interop dual mode contamination (pygae#556, closes pygae#555), norm() Abs wrapping (pygae#554, closes pygae#522), is_versor() improvement (pygae#536, closes pygae#533). Examples/docs: sundial + cheatsheet tests (pygae#549+pygae#557, closes pygae#506), coords tutorial (pygae#551), README ops (pygae#548, closes pygae#523). Tests/maintenance: lt.matrix() regression tests (pygae#558, closes pygae#461), extra-cdot regression test (pygae#545), er_blade + ReciprocalFrame refactors (pygae#552+pygae#553), CI fix (pygae#535).
utensil
pushed a commit
that referenced
this pull request
Apr 1, 2026
* docs: add 0.6.0 changelog entries Groups new entries by: features, bug fixes, examples/docs, tests/maintenance. Features: Cl() kingdon interface (#550, closes #524), Mv.__rtruediv__ (#543, closes #512), shirokov_inverse/hitzer_inverse (#530). Bugs: interop dual mode contamination (#556, closes #555), norm() Abs wrapping (#554, closes #522), is_versor() improvement (#536, closes #533). Examples/docs: sundial + cheatsheet tests (#549+#557, closes #506), coords tutorial (#551), README ops (#548, closes #523). Tests/maintenance: lt.matrix() regression tests (#558, closes #461), extra-cdot regression test (#545), er_blade + ReciprocalFrame refactors (#552+#553), CI fix (#535). * docs: add missing issue link for #551 entry * docs: add changelog entry for #560 (Lt callable zero fix) * docs: move Lt zero fix into bug group, use issue #540 as reference
utiberious
added a commit
to utiberious/galgebra
that referenced
this pull request
Apr 2, 2026
…an metrics (pygae#461) (pygae#558) * test(lt): add regression tests for lt.matrix() on oblique/non-Euclidean metrics (pygae#461) Adds two tests to confirm the bugs reported in pygae#461 are fixed: - test_lt_matrix_oblique: lt.matrix() on oblique g=[[1,1],[1,2]] and Minkowski g=diag(1,-1) returns the bare coefficient matrix without metric tensor factors - test_lt_generic_oblique: Ga.lt('f') on oblique metric produces f(e_j) with plain symbol coefficients and a matching matrix() * style(lt): move Symbol import to top-level per review
utiberious
added a commit
to utiberious/galgebra
that referenced
this pull request
Apr 2, 2026
* docs: add 0.6.0 changelog entries Groups new entries by: features, bug fixes, examples/docs, tests/maintenance. Features: Cl() kingdon interface (pygae#550, closes pygae#524), Mv.__rtruediv__ (pygae#543, closes pygae#512), shirokov_inverse/hitzer_inverse (pygae#530). Bugs: interop dual mode contamination (pygae#556, closes pygae#555), norm() Abs wrapping (pygae#554, closes pygae#522), is_versor() improvement (pygae#536, closes pygae#533). Examples/docs: sundial + cheatsheet tests (pygae#549+pygae#557, closes pygae#506), coords tutorial (pygae#551), README ops (pygae#548, closes pygae#523). Tests/maintenance: lt.matrix() regression tests (pygae#558, closes pygae#461), extra-cdot regression test (pygae#545), er_blade + ReciprocalFrame refactors (pygae#552+pygae#553), CI fix (pygae#535). * docs: add missing issue link for pygae#551 entry * docs: add changelog entry for pygae#560 (Lt callable zero fix) * docs: move Lt zero fix into bug group, use issue pygae#540 as reference
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.
Closes #461
Both bugs reported in #461 are already fixed (by Eric's commit and GSG's code in PR 510). This PR adds regression tests to prevent regressions.
Two new tests in
test/test_lt.py:test_lt_matrix_oblique—lt.matrix()on obliqueg=[[1,1],[1,2]]and Minkowskig=diag(1,-1)must return the bare coefficient matrix, not one post-multiplied by the metric tensor.test_lt_generic_oblique—Ga.lt('f')on an oblique metric must producef(e_j) = f_1j*e1 + f_2j*e2with plain symbol coefficients, not metric-weighted expressions.