Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6702 +/- ##
==========================================
+ Coverage 79.36% 79.65% +0.28%
==========================================
Files 683 684 +1
Lines 295286 295641 +355
Branches 8646 8655 +9
==========================================
+ Hits 234366 235485 +1119
+ Misses 59106 58329 -777
- Partials 1814 1827 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fingolfin
left a comment
There was a problem hiding this comment.
Thanks for splitting this off. The inline comments have the details on the code; two general points here.
Tests. This PR has no test file, only the two manual examples, and both use whole small rings, where everything works. Please add tst/testinstall/ring-dsum.tst (or a similar name) which also covers a sum of subrings, a sum of three rings, and a check like ForAll( R, x -> ( x ^ Embedding( D, i ) ) ^ Projection( D, i ) = x ). As in #6618, let Test( file, rec( rewriteToFile := file ) ) write the expected output, so that the line breaks are right.
Your question about first. Changing the generic method from [1] to [0] breaks nothing: no code in GAP itself, and none in the packages I have installed, reads DirectSumInfo or its first component, and all checks here pass. Making the two methods agree is good. It does not make the new methods work for such sums, though; see the inline comment on the Embedding method.
AI disclosure: I used Claude Code (Opus 5.5) to review this PR. It built the branch, ran the examples quoted in the comments, and drafted the comments.
|
Note: the direct sum of three rings A,B,C gives info.rings = [A,B,C] and not [(A(+)B),C] as with algebras. |
Embedding and Projection for direct sums of rings
fingolfin
left a comment
There was a problem hiding this comment.
This is looking pretty good now. We could merge it, but perhaps you'd be inclined to add the subring test (I made a "change suggestion" you could apply with a click). Also some other very minor nits (not important)
Co-authored-by: Max Horn <max@quendi.de>
Co-authored-by: Max Horn <max@quendi.de>
Co-authored-by: Max Horn <max@quendi.de>
Co-authored-by: Max Horn <max@quendi.de>
|
The extended test file runs well for me. Sorry about the "#A's - should have noticed that. All looks good now. |
These small additions were originally in PR #6618 but, as advised, have been moved to a separate PR.
Having added Embedding and Projection for direct sums of algebras, it seemed sensible to provide the same for rings since DirectSum sets up an info record with empty info.embeddings and info.projections.
The first method for DirectSumOp in ringsc.gi initialises info.first as [1], but the second method (which gets called in the example used here) uses [0]. (That was why [0] was used in the methods for algebras.) To fix this inconsistency, the first method has been changed to [0]. Whether this method is used anywhere, and whether some test now fails, remains to be seen!