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

Rename MPolynomialRing_generic -> MPolynomialRing_base #25563

Closed
jdemeyer opened this issue Jun 12, 2018 · 7 comments
Closed

Rename MPolynomialRing_generic -> MPolynomialRing_base #25563

jdemeyer opened this issue Jun 12, 2018 · 7 comments

Comments

@jdemeyer
Copy link

The name MPolynomialRing_generic is confusing because it's not a generic implementation: it's essentially an abstract base class. One cannot create elements of it:

sage: from sage.rings.polynomial.multi_polynomial_ring_generic import MPolynomialRing_generic
sage: R = MPolynomialRing_generic(ZZ, 2, ["a", "b"], "lex")
sage: R()
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-5-5a32ac3184a1> in <module>()
----> 1 R()

/usr/local/src/sage-git/local/lib/python2.7/site-packages/sage/structure/parent.pyx in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9489)()
    899         """
    900         if self._element_constructor is None:
--> 901             raise NotImplementedError(f"cannot construct elements of {self}")
    902         cdef Py_ssize_t i
    903         cdef R = parent(x)

NotImplementedError: cannot construct elements of Multivariate Polynomial Ring in a, b over Integer Ring

Typically, the word "generic" means an implementation which works over any ring, for example:

sage: type(matrix(QQbar, 2, 2))
<type 'sage.matrix.matrix_generic_dense.Matrix_generic_dense'>

In two cases, the import of MPolynomialRing_generic was simply removed because it was not used.

Component: basic arithmetic

Author: Jeroen Demeyer

Branch/Commit: fc2a02c

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/25563

@jdemeyer jdemeyer added this to the sage-8.3 milestone Jun 12, 2018
@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link
Author

@jdemeyer
Copy link
Author

New commits:

fc2a02cRename MPolynomialRing_generic -> MPolynomialRing_base

@jdemeyer
Copy link
Author

Commit: fc2a02c

@tscrim
Copy link
Collaborator

tscrim commented Jun 12, 2018

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Jun 12, 2018

comment:4

Makes sense. LGTM.

@vbraun
Copy link
Member

vbraun commented Jun 14, 2018

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

No branches or pull requests

3 participants