Skip to content

Do not require the SmallGrp package - #34

Merged
Stefan-Kohl merged 3 commits into
masterfrom
mh/no-smallgrp
Jul 30, 2026
Merged

Do not require the SmallGrp package#34
Stefan-Kohl merged 3 commits into
masterfrom
mh/no-smallgrp

Conversation

@fingolfin

Copy link
Copy Markdown
Member

Viewing or displaying an rcwa group fails when the SmallGrp package is not loaded:

gap> G := Group(ClassTransposition(0,2,1,2));
<rcwa group over Z with
1 generatorError, Variable: 'HasIdGroup' must have an assigned value

The ViewObj and Display methods in lib/rcwagrp.gi mention the isomorphism type of a group if IdGroup happens to be known, but both that attribute and its tester HasIdGroup are provided by SmallGrp.

Since only SmallGrp can set the attribute, it is certainly not set when the package is absent, so treating it as unset in that case is safe. This adds two helpers, RCWA_HasIdGroup and RCWA_IdGroup, and uses them in the two places concerned. Output is unchanged when SmallGrp is available, and falls back to printing the order otherwise.

Note the helpers deliberately go through ValueGlobal: writing HasIdGroup(G) textually — even behind a working IsBound guard — still makes GAP emit Syntax warning: Unbound global variable while reading the file. With this change RCWA loads without any such warnings.

Four tests in tst/integral.tst also needed SmallGrp: two call IdGroup directly, and two use StructureDescription, which yields prettier names when it can consult NAMES_OF_SMALL_GROUPS. These are guarded with the #@if syntax of the test file parser. For the IdGroup case there is an #@else branch, so the new fallback output is covered too.

Testing

  • gap --bare -c 'LoadPackage("GAPDoc");' + LoadPackage("rcwa" : OnlyNeeded) + TestPackage("rcwa") — 0 failures in 14 files, and no syntax warnings. Previously 58 differences.
  • Normal run with full package autoload — 0 failures in 14 files, output unchanged.

I have left PackageInfo.g and the release date in CHANGES.md alone, so this needs a version bump and release on your side.

Context

This comes out of gap-system/gap#2434, which aims to make GAP and its packages work when PrimGrp/SmallGrp/TransGrp are not installed. RCWA showed up in a PackageDistro CI experiment running package test suites under gap --bare.

🤖 Generated with Claude Code

fingolfin and others added 3 commits July 29, 2026 02:06
The `ViewObj' and `Display' methods for rcwa groups mention the
isomorphism type of the group if `IdGroup' happens to be known. Both the
attribute `IdGroup' and its tester `HasIdGroup' are provided by the
SmallGrp package though, so without it viewing or displaying an rcwa
group failed with

    Error, Variable: 'HasIdGroup' must have an assigned value

Only SmallGrp can set that attribute, hence it is certainly not set when
the package is absent. Add the helpers `RCWA_HasIdGroup' and
`RCWA_IdGroup' which take that into account, and use them in the two
places in question; the output is unchanged when SmallGrp is available,
and falls back to printing the order otherwise.

See gap-system/gap#2434

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Four tests in tst/integral.tst require SmallGrp: two call `IdGroup'
directly (and check that the isomorphism type then shows up in the
`ViewObj' output), and two use `StructureDescription', which produces
prettier names when it can look up `NAMES_OF_SMALL_GROUPS' via `IdGroup'.

Guard these using the `#@if' syntax of the test file parser. For the
`IdGroup' case add an `#@else' branch, so that the fallback of printing
the order rather than the isomorphism type is covered as well.

See gap-system/gap#2434

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.58%. Comparing base (dbedaff) to head (74d98a8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #34   +/-   ##
=======================================
  Coverage   99.58%   99.58%           
=======================================
  Files          47       47           
  Lines      366226   366230    +4     
=======================================
+ Hits       364707   364711    +4     
  Misses       1519     1519           
Files with missing lines Coverage Δ
lib/rcwagrp.gi 84.05% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fingolfin

Copy link
Copy Markdown
Member Author

@Stefan-Kohl are you OK with these changes, and putting them into a release? happy to answer questions

@Stefan-Kohl
Stefan-Kohl merged commit 34a3564 into master Jul 30, 2026
5 checks passed
@Stefan-Kohl
Stefan-Kohl deleted the mh/no-smallgrp branch July 30, 2026 14:26
@Stefan-Kohl

Copy link
Copy Markdown
Member

@fingolfin Thanks - the changes are fine with me. I have made a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants