- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 570
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
Clean up polynomial constructor #23338
Comments
comment:1
+1 |
Commit: |
comment:3
First version, not finished or tested yet. But feel free to comment... New commits:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
This comment has been minimized.
This comment has been minimized.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:14
My quick comments are:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:16
Replying to @tscrim:
No, the current code is intentional. I only want to support
and not
The preparser passes
What do you mean with this?
Well, that would make the code slightly more complicated since that check needs to be done after
Yes, it's stupid to write that but we do allow the analogous thing without
Right. I didn't care much about |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:19
I think this addresses your comments, except for the ones regarding the redundant |
comment:20
Replying to @jdemeyer:
Ah, I see. Okay.
Most of the code that checks for input of this form is already in the code path when
I agree with this. I missed the
I did the initial implementation because I got a few requests to have such a feature (which is useful for doing matrices with generic parameters). So I care a little bit. :) I'm wondering if we should always have a one variable implementation always be a univariate polynomial ring, of course with |
comment:21
Replying to @tscrim:
I don't agree that it only expands functionality. In at least 2 places, the Sage library has been using |
comment:22
It seems that there are quite a bit of places in Sage which rely on the behaviour that specifying 1 variable gives a multivariate polynomial ring. For example, doctests checking whether some algorithm for multivariate rings also deals with the 1-variable case properly. So I feel inclined to keep the current behaviour. |
comment:23
Fair enough. Although in some ways changing the behavior makes the doctests a little moot...but one could directly call the constructor class (or pass |
comment:24
So it looks like we took care of all places that are using |
comment:25
Replying to @tscrim:
I actually think that there are more places like that. I'll try to fix them all. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:27
Thanks. LGTM. |
Reviewer: Travis Scrimshaw |
Changed branch from u/jdemeyer/clean_up_polynomial_constructor to |
This ticket cleans up the
PolynomialRing()
function in many ways. Mainly:Use
normalize_names()
as much as possible to deal with variable names.Fix indentation in docstring.
Pass arguments like
sparse
andimplementation
as**kwds
to the single-variate or multi-variate polynomial constructor.Make the code easier to understand.
Allow
PolynomialRing(..., implementation="singular")
which forces Singular. This allows simplifying some code insrc/sage/algebras/free_algebra.py
which currently needs to jump through hoops to get aMPolynomialRing_libsingular
.Check more error conditions, for example currently we have
PolynomialRing()
to keyword-only arguments. This does break some existing uses ofPolynomialRing()
, although much more likely in library code and not user code (some code in Sage gets this even wrong and was passingsparse="lex"
instead oforder="lex"
)Apart from items 6 and 7, no existing functionality is changed.
CC: @tscrim
Component: algebra
Author: Jeroen Demeyer
Branch/Commit:
fc75734
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/23338
The text was updated successfully, but these errors were encountered: