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

Split off _polymod and _rational #1

Merged

Conversation

kwankyu
Copy link

@kwankyu kwankyu commented Mar 15, 2023

I did the needed refactoring. Hopefully, this suffices to split off the rational function fields module to be included into sagemath-categories.

I fixed most failures except

sage -t --random-seed=271090278950642484948076320506901219620 src/sage/rings/polynomial/multi_polynomial_sequence.py  # Killed due to segmentation fault
sage -t --random-seed=271090278950642484948076320506901219620 src/sage/rings/polynomial/pbori/pbori.pyx  # Killed due to segmentation fault
sage -t --random-seed=271090278950642484948076320506901219620 src/sage/rings/polynomial/pbori/nf.py  # Killed due to abort

I don't know how these are related with the refactoring...

Martin Rubey and others added 30 commits January 4, 2023 21:17
- line 66: cal
- line 79: function ring before definition
- line 119: rewrite the note
- line 140: other word for "precising"
- line 190: pep8
There is now an optional `latexname=None` argument given at init.
Release Manager and others added 13 commits March 11, 2023 00:43
…ore beautiful

    
These are mostly either of the form of unindenting text that was
accidentally put in a code block, or correctly adding `::` or
`EXAMPLES::` so that docs render nicely.

<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
### 📚 Description

<!-- Describe your changes here in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes sagemath#1337" -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [ ] 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
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
    
URL: sagemath#35069
Reported by: Alex J Best
Reviewer(s): Alex J Best, Frédéric Chapoton, Travis Scrimshaw
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
### 📚 Description

<!-- Describe your changes here in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes sagemath#1337" -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

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

### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
    
URL: sagemath#35070
Reported by: Sanjay Rijal
Reviewer(s): Alex J Best, Matthias Köppe, Sanjay Rijal
…t of pairs to dedicated class

    
### 📚 Description

`CombinatorialPolyhedron` currently contains a lot of code related to
(possibly long) lists of pairs. This code can and should be moved
elsewhere. This is a step towards better readability and allowing future
changes to the code.

This is a first step of sagemath#34773.

Along the way I update my outdated email address.

<!-- Describe your changes here in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes sagemath#1337" -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

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

### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
    
URL: sagemath#35073
Reported by: Jonathan Kliem
Reviewer(s): Jonathan Kliem, Matthias Köppe, Travis Scrimshaw
…ular, InfinitePolynomial; deprecate is_Polynomial, is_MPolynomial

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
### 📚 Description

<!-- Describe your changes here in detail -->
<!-- Why is this change required? What problem does it solve? -->
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes sagemath#1337" -->
Closes sagemath#32709

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

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

### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
    
URL: sagemath#35076
Reported by: Matthias Köppe
Reviewer(s): Travis Scrimshaw
… published on ghcr.io

<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
### 📚 Description

<!-- Describe your changes here in detail -->
We shorten the names of the Docker images generated by our portability
tests slightly by removing the redundant word `docker` from it.
<!-- Why is this change required? What problem does it solve? -->
This is done because the previously used names still belong to the old
repository (which is now renamed as sagemath/sage-archive-...), and the
new repository does not have permissions to push new versions there.
This can be changed package by package in the web interface, but there
is no API for doing so and we have over 1000 packages. So instead we
change the naming pattern; the removal of the redundant word is a
welcome side effect.
<!-- If it resolves an open issue, please link to the issue here. For
example "Closes sagemath#1337" -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

- [x] 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.
- [x] I have updated the documentation accordingly.

### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->

URL: sagemath#35079
Reported by: Matthias Köppe
Reviewer(s): Dima Pasechnik, Tobias Diez
sort result of doctest to avoid random failures
We provide a toolkit for the combinatorialist to help find functions
("statistics") s: A -> Z and bijections A -> B given sequences of finite
sets A and B that satisfy various constraints.

Closes sagemath#33238

### 📝 Checklist

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

URL: sagemath#35060
Reported by: Martin Rubey
Reviewer(s): Martin Rubey, Matthias Köppe, Travis Scrimshaw
@mkoeppe
Copy link
Owner

mkoeppe commented Mar 15, 2023

Thanks a lot for working on this, looking great. Probably some lazy_imports with deprecation are needed for the moved classes

@kwankyu
Copy link
Author

kwankyu commented Mar 15, 2023

Fixed merge failure with 10.0.beta4.

@kwankyu
Copy link
Author

kwankyu commented Mar 15, 2023

Probably some lazy_imports with deprecation are needed for the moved classes

Yes. Things to do later when everything works fine.

@kwankyu
Copy link
Author

kwankyu commented Mar 15, 2023

The above doctest failures are genuine, but there's no clue where things got wrong...

@kwankyu
Copy link
Author

kwankyu commented Mar 15, 2023

Probably some lazy_imports with deprecation are needed for the moved classes

Most, if not all, of the moved classes are internal, I guess.

@kwankyu
Copy link
Author

kwankyu commented Mar 16, 2023

I tested the branch on another sage install, and it passes all doctests including the above three. It seems the previous sage install is in a somewhat corrupted state.

So I am done with what I intended. What should we do now? I think you should merge this PR to your PR and update the optional tags (and then I can do necessary updates in the documentation). In another PR, sagemath-categories needs to be updated...

Perhaps before you update optional tags, do we need to change or move around doctests (and documentation) in, say, order.py? Perhaps this will be installed by sagemath-categories as part of the rational function fields module. Then could it have doctests about non-rational function fields? Such doctests should have, say, # optional - sage.rings.function_field?

@mkoeppe mkoeppe merged commit 7c93db4 into mkoeppe:refactor_function_field Mar 16, 2023
@mkoeppe
Copy link
Owner

mkoeppe commented Mar 16, 2023

I've merged it into PR sagemath#35230 and rebased on 10.0.beta4.
Let's continue the discussion over there.

@kwankyu
Copy link
Author

kwankyu commented Mar 16, 2023

Thanks.

mkoeppe pushed a commit that referenced this pull request Mar 26, 2023
    
### 📚 Description

Trac branch `u/gh-collares/gap-gc` from sagemath#34701, now migrated to GitHub.
Currently based atop sagemath#35093; will rebase once that is merged.

The rest of the description below is copied from sagemath#34701:

A refactor in sagemath#27946 introduced "unprotected" (not surrounded by
`GAP_Enter`/`GAP_Leave`) `GAP_ValueGlobalVariable` calls. I believe this
might be a GC hazard, because after updating to GAP 4.12.1 I started
seeing aarch64 crashes on NixOS infrastructure such as:

```
#0  0x0000fffff79740e8 in wait4 ()
#1  0x0000fffff5dc6b78 in print_enhanced_backtrace ()
#2  0x0000fffff5dc8190 in sigdie ()
#3  0x0000fffff5dcb1c0 in cysigs_signal_handler ()
#4  0x0000fffff7ffb7cc in __kernel_rt_sigreturn ()
#5  0x0000ffff99a0bf28 in ConvString ()
#6  0x0000000000000000 in ?? ()
#7  0x0000000000000000 in ?? ()
#8  0x0000000000000000 in ?? ()
#9  0x0000ffff99989930 in Pr ()
#10 0x0000ffff9998aa18 in CloseOutput ()
#11 0x0000ffff99884828 in capture_stdout () at /build/sage-
src-9.7/pkgs/sagemath-standard/sage/libs/gap/element.pyx:154
...
```
I also see cases where `capture_stdout` throws errors such as
`sage.libs.gap.util.GAPError: Error, Length: <list> must be a list (not
the integer 255)` and then crashes. Both types of errors are fixed by
this ticket.

Note that I am nesting `GAP_Enter`/`GAP_Leave` calls because I didn't
remove the preexisting calls inside `capture_stdout`. That's because I
feared removing the innermost calls might create a new footgun (and I
believe nested `GAP_Enter`/`GAP_Leave` calls are explicitly supported),
but removing them should cause no problem. Removing them might even be
preferable for performance reasons, I don't know.

Fixes sagemath#34701

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

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

### ⌛ Dependencies
<!-- List all open pull requests that this PR logically depends on -->
<!--
- #xyz: short description why this is a dependency
- #abc: ...
-->
- sagemath#35093: GAP 4.12.2 upgrade, which touches the same function and should
land first.
    
URL: sagemath#35114
Reported by: Mauricio Collares
Reviewer(s): Dima Pasechnik
mkoeppe pushed a commit that referenced this pull request Jun 29, 2023
move bliss_find_automorphisms.h to subdir
mkoeppe pushed a commit that referenced this pull request Aug 28, 2023
@kwankyu kwankyu deleted the p/35230/refactor_function_field branch September 11, 2023 03:13
mkoeppe pushed a commit that referenced this pull request Oct 8, 2023
mkoeppe pushed a commit that referenced this pull request Aug 14, 2024
For C-return-type functions that raise exceptions (and their heirs).
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.