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.{dynamics,schemes}: Modularization fixes, docstring cosmetics, update # needs #36271

Merged
merged 35 commits into from
Oct 31, 2023

Conversation

mkoeppe
Copy link
Member

@mkoeppe mkoeppe commented Sep 16, 2023

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

@mkoeppe mkoeppe self-assigned this Sep 16, 2023
@mkoeppe mkoeppe changed the title sage.{dynamics,schemes}: Update # needs sage.{dynamics,schemes}: Modularization fixes, docstring cosmetics, update # needs Sep 16, 2023
@mkoeppe mkoeppe force-pushed the needs_for_sage_schemes_sage_dynamics branch from 37d1671 to d8141b2 Compare September 16, 2023 18:39
@mkoeppe mkoeppe mentioned this pull request Sep 21, 2023
3 tasks
sage: B = Berkovich_Cp_Projective(P, ideal)
sage: f = DynamicalSystem_Berkovich([x^2 + y^2, 2*x*y], B)
sage: f.scale_by(2); f
sage: A.<a> = NumberField(z^3 + 20) # needs sage.rings.number_field
Copy link
Contributor

Choose a reason for hiding this comment

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

block scope

Copy link
Member Author

@mkoeppe mkoeppe Oct 1, 2023

Choose a reason for hiding this comment

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

Thanks. I've redone this file in e38afeb with a file tag for "sage.rings.padics" and block tags for "sage.rings.number_field"

src/sage/dynamics/arithmetic_dynamics/berkovich_ds.py Outdated Show resolved Hide resolved
src/sage/dynamics/arithmetic_dynamics/projective_ds.py Outdated Show resolved Hide resolved
src/sage/dynamics/arithmetic_dynamics/projective_ds.py Outdated Show resolved Hide resolved
src/sage/dynamics/arithmetic_dynamics/projective_ds.py Outdated Show resolved Hide resolved
src/sage/dynamics/arithmetic_dynamics/projective_ds.py Outdated Show resolved Hide resolved
[(1 : 1), (4/3 : 1), (1 : 0), (0 : 1)]

::

sage: K.<v> = QuadraticField(2)
sage: P.<x,y> = ProjectiveSpace(K,1)
sage: K.<v> = QuadraticField(2) # needs sage.rings.number_field
Copy link
Contributor

Choose a reason for hiding this comment

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

block scope (and many other places in this file)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 8443583

@@ -330,17 +335,17 @@ def Gpoly(self, component, k):
Return the G polynomials `G^*_k`.

They are defined as:
`G^*_k = \left(L^*_j\right)^2Q^*_{ii}-L^*_iL^*_jQ^*_{ij}+\left(L^*_i\right)^2Q^*_{jj}`\
`G^*_k = \left(L^*_j\right)^2Q^*_{ii}-L^*_iL^*_jQ^*_{ij}+\left(L^*_i\right)^2Q^*_{jj}`
where {i, j, k} is some permutation of (0, 1, 2) and * is either
Copy link
Contributor

Choose a reason for hiding this comment

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

math mode ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in 869d776

@@ -905,11 +913,11 @@ def degenerate_primes(self,check=True):
[2, 3, 5, 11, 23, 47, 48747691, 111301831]
"""
PP = self.ambient_space()
if PP.base_ring() in _NumberFields or is_NumberFieldOrder(PP.base_ring()):
if PP.base_ring() != ZZ and PP.base_ring() != QQ:
if PP.base_ring() != ZZ and PP.base_ring() != QQ:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure of that this change is correct. You changed the order of the tests but not of the error messages...

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I've rephrased it in 869d776

@@ -717,25 +722,25 @@ def helper_matrix(Q):

def lift(x):
r"""
Try to call x.lift(), presumably from the `p`-adics to ZZ.
Try to call ``x.lift()``, presumably from the `p`-adics to ``ZZ``.
Copy link
Contributor

Choose a reason for hiding this comment

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

In other places you used \ZZ, but both are ok I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've changed it, as part of 1b873b9

@dcoudert
Copy link
Contributor

dcoudert commented Oct 2, 2023

The CI reports the following error

  /sage/src/sage/dynamics/arithmetic_dynamics/projective_ds.py:1741:20 - error: "tuple[Type[TypeError], Unknown | tuple[()]]" is not valid exception class

However, I can compile without error on my laptop.

@github-actions
Copy link

Documentation preview for this PR (built with commit 7033d7d; changes) is ready! 🎉

Copy link
Contributor

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

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

all tests pass on my macOS laptop. LGTM.

@mkoeppe
Copy link
Member Author

mkoeppe commented Oct 22, 2023

Thank you!

vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 24, 2023
…cstring cosmetics, update `# needs`

    
<!-- ^^^^^
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"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Part of: sagemath#29705
- Cherry-picked from: sagemath#35095
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 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! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36271
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 26, 2023
…cstring cosmetics, update `# needs`

    
<!-- ^^^^^
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"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Part of: sagemath#29705
- Cherry-picked from: sagemath#35095
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 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! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36271
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 28, 2023
…cstring cosmetics, update `# needs`

    
<!-- ^^^^^
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"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Part of: sagemath#29705
- Cherry-picked from: sagemath#35095
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 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! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36271
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 28, 2023
…cstring cosmetics, update `# needs`

    
<!-- ^^^^^
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"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Part of: sagemath#29705
- Cherry-picked from: sagemath#35095
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 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! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36271
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 29, 2023
…cstring cosmetics, update `# needs`

    
<!-- ^^^^^
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"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Part of: sagemath#29705
- Cherry-picked from: sagemath#35095
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 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! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36271
Reported by: Matthias Köppe
Reviewer(s): David Coudert, Matthias Köppe
@vbraun vbraun merged commit 6afeae8 into sagemath:develop Oct 31, 2023
18 of 26 checks passed
@mkoeppe mkoeppe added this to the sage-10.2 milestone Oct 31, 2023
@tobiasdiez
Copy link
Contributor

Pyright check fails because of this PR.

@dcoudert
Copy link
Contributor

dcoudert commented Nov 2, 2023

Do we have any indication of what's going on / the localisation of the problem ?

@dcoudert
Copy link
Contributor

dcoudert commented Nov 2, 2023

I see, it's this change in src/sage/dynamics/arithmetic_dynamics/projective_ds.py

try:
    from sage.libs.pari.all import PariError
except ImportError:
    PariError = ()

that makes Pyright unhappy with

            try:
                res = (f.lc() ** (d - g.degree()) * g.lc() ** (d - f.degree())
                       * f.__pari__().polresultant(g, x))
                return self.domain().base_ring()(res)
            except (TypeError, PariError):
                pass

What should be the correct default value for PariError ?

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

4 participants