Skip to content

test(lt): add regression tests for lt.matrix() on oblique/non-Euclidean metrics (#461)#558

Merged
utensil merged 2 commits intopygae:masterfrom
utiberious:fix/issue-461-lt-matrix-oblique-test
Apr 1, 2026
Merged

test(lt): add regression tests for lt.matrix() on oblique/non-Euclidean metrics (#461)#558
utensil merged 2 commits intopygae:masterfrom
utiberious:fix/issue-461-lt-matrix-oblique-test

Conversation

@utiberious
Copy link
Copy Markdown
Contributor

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_obliquelt.matrix() on oblique g=[[1,1],[1,2]] and Minkowski g=diag(1,-1) must return the bare coefficient matrix, not one post-multiplied by the metric tensor.

test_lt_generic_obliqueGa.lt('f') on an oblique metric must produce f(e_j) = f_1j*e1 + f_2j*e2 with plain symbol coefficients, not metric-weighted expressions.

…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()
Copy link
Copy Markdown
Member

@utensil utensil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@utensil utensil added this to the 0.6.0 milestone Apr 1, 2026
@utensil utensil merged commit 7762455 into pygae:master Apr 1, 2026
6 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

actions of generic linear transformations; matrices of linear transformations

2 participants