Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage.groups.matrix_gps: Modularization fixes for imports #35306

Merged
merged 24 commits into from Apr 23, 2023

Conversation

mkoeppe
Copy link
Member

@mkoeppe mkoeppe commented Mar 18, 2023

πŸ“š Description

We move the ...MatrixGroup_gap classes to separate modules named ..._gap.

This is part of:

πŸ“ Checklist

  • I have made sure that the title is self-explanatory and the description concisely explains the PR.
  • I have linked an issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

βŒ› Dependencies

@mkoeppe mkoeppe self-assigned this Mar 18, 2023
@mkoeppe mkoeppe changed the title sage.groups.matrix_gps: Modularization fixes for imports sage.groups.matrix_gps: Modularization fixes for imports Mar 18, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2023

Codecov Report

Patch coverage: 89.69% and project coverage change: -0.02 ⚠️

Comparison is base (c00e6c2) 88.62% compared to head (c362fb7) 88.61%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #35306      +/-   ##
===========================================
- Coverage    88.62%   88.61%   -0.02%     
===========================================
  Files         2148     2155       +7     
  Lines       398855   398915      +60     
===========================================
+ Hits        353480   353484       +4     
- Misses       45375    45431      +56     
Impacted Files Coverage Ξ”
src/sage/groups/affine_gps/affine_group.py 82.02% <ΓΈ> (-16.86%) ⬇️
src/sage/groups/affine_gps/euclidean_group.py 50.00% <ΓΈ> (-50.00%) ⬇️
src/sage/groups/affine_gps/group_element.py 89.38% <ΓΈ> (-5.31%) ⬇️
src/sage/matrix/matrix_space.py 89.07% <69.23%> (-0.55%) ⬇️
src/sage/groups/matrix_gps/orthogonal.py 92.85% <71.42%> (-4.62%) ⬇️
src/sage/groups/matrix_gps/unitary.py 82.08% <71.42%> (-9.70%) ⬇️
src/sage/groups/matrix_gps/symplectic.py 88.88% <77.77%> (-8.99%) ⬇️
src/sage/groups/matrix_gps/linear.py 84.90% <80.00%> (-6.40%) ⬇️
src/sage/groups/matrix_gps/finitely_generated.py 83.33% <87.50%> (-7.18%) ⬇️
...c/sage/groups/matrix_gps/finitely_generated_gap.py 89.28% <89.28%> (ΓΈ)
... and 15 more

... and 28 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

β˜” View full report in Codecov by Sentry.
πŸ“’ Do you have feedback about the report comment? Let us know in this issue.

@mkoeppe mkoeppe requested a review from tscrim March 28, 2023 07:22
SageMath version 10.0.beta7, Release Date: 2023-04-01
…ite_rings' when GF is involved, add '# optional - sage.symbolic'
SageMath version 10.0.beta8, Release Date: 2023-04-06
@kwankyu
Copy link
Collaborator

kwankyu commented Apr 14, 2023

Looks good in the first pass.

Would you put the boilerplate things like copyright notices in the new files?

@mkoeppe
Copy link
Member Author

mkoeppe commented Apr 14, 2023

Done.

@mkoeppe mkoeppe force-pushed the matrix_groups_modularization branch from 0aeb747 to bea635b Compare April 14, 2023 22:56
…sed on 'git blame -M -C -w --date=format:%Y FILE.py | sort -k2'
Copy link
Collaborator

@kwankyu kwankyu left a comment

Choose a reason for hiding this comment

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

Thanks.

@github-actions
Copy link

Documentation preview for this PR is ready! πŸŽ‰
Built with commit: 1024a23

@mkoeppe
Copy link
Member Author

mkoeppe commented Apr 17, 2023

Thank you!

@vbraun vbraun merged commit 55ebb79 into sagemath:develop Apr 23, 2023
8 of 9 checks passed
@mkoeppe mkoeppe added this to the sage-10.0 milestone Apr 23, 2023
@antonio-rojas
Copy link
Contributor

I'm getting a test failure on Arch with system GAP 4.12.2 after this

**********************************************************************
File "/usr/lib/python3.10/site-packages/sage/groups/matrix_gps/finitely_generated_gap.py", line 124, in sage.groups.matrix_gps.finitely_generated_gap.FinitelyGeneratedMatrixGroup_gap.as_permutation_group
Failed example:
    P == Psmaller
Expected:
    False
Got:
    True
**********************************************************************

Strangely, the exact same test passed when it was in finitely_generated.py

@kwankyu
Copy link
Collaborator

kwankyu commented Apr 28, 2023

To examine the failure, I tried to run tox -e docker-archlinux-latest-standard but this failed with

...
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
            environment-variable.
...
Step 16/44 : RUN sh -x -c "${BOOTSTRAP}"
 ---> Running in 3cf527175f0d
+ ./bootstrap
bootstrap:39: installing 'm4/sage_spkg_configures.m4'
/sage/build/bin/sage-bootstrap-python: error: none of python python3 python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python2.7 python3.6 python2 is a suitable Python
...

Next I tried to run ci linux workflow on my fork of sage. It also failed (actually all flavors of linux failed)

Screen Shot 2023-04-28 at 2 03 40 PM

What did I wrong? I have zero experience in testing sage on linux platforms, by the way.

@dimpase
Copy link
Member

dimpase commented Apr 28, 2023

It's probably a bug in tox file. Anyway, you can just run archlinux in Docker, and build Sage there the usual way.

@kwankyu
Copy link
Collaborator

kwankyu commented Apr 28, 2023

Yes. This is a good opportunity for me to try sage on linux.

@antonio-rojas
Copy link
Contributor

After some more testing, it seems to be the line

56    sage: TestSuite(G).run()

which triggers this. It is somehow interfering with the random generator status of GAP.
The test

132    sage: Psmaller.degree()                     # random

was marked as # random in c362fb7 (with no given reason), I guess the same should be done for this one.

@dimpase
Copy link
Member

dimpase commented Apr 28, 2023

tagging everything #random is a bit lame. One can reset GAP's RNG before a test, like this:

gap.Reset(gap.GlobalMersenneTwister,"42")
libgap.Reset(libgap.GlobalMersenneTwister,"42")

(this is both for pexpect and libgap interfaces - probably just one of these is needed)

@antonio-rojas
Copy link
Contributor

tagging everything #random is a bit lame. One can reset GAP's RNG before a test, like this:

gap.Reset(gap.GlobalMersenneTwister,"42")
libgap.Reset(libgap.GlobalMersenneTwister,"42")

(this is both for pexpect and libgap interfaces - probably just one of these is needed)

That's done in the Psmaller constructor already, so the difference must come from somewhere else.

@antonio-rojas
Copy link
Contributor

Things get weirder, it depends on the order in which P and Psmaller are defined:

sage: imf = libgap.function_factory('ImfMatrixGroup')
sage: GG = imf( 12, 3 )
sage: G = MatrixGroup(GG.GeneratorsOfGroup())
sage: P = G.as_permutation_group()
sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
sage: P == Psmaller
False

vs

sage: imf = libgap.function_factory('ImfMatrixGroup')
sage: GG = imf( 12, 3 )
sage: G = MatrixGroup(GG.GeneratorsOfGroup())
sage: Psmaller = G.as_permutation_group(algorithm="smaller", seed=6)
sage: P = G.as_permutation_group()
sage: P == Psmaller
True

@dimpase
Copy link
Member

dimpase commented Apr 28, 2023

How about replacing the iffy test with

sage: P._libgap_().GroupHomomorphismByImages(Psmaller._libgap_()).Kernel()
Group(())

@antonio-rojas
Copy link
Contributor

I finally figured out why this happens only when using system gap: the difference is the radiroot package, which is not installed by our gap system package. Why it has this side effect, I have no idea.

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.

None yet

6 participants