Opened 14 years ago

Closed 13 years ago

#5482 closed defect (fixed)

Quotient ring can be created without generator names

Reported by: Justin Walker Owned by: Justin Walker
Priority: major Milestone: sage-4.3
Component: algebra Keywords:
Cc: Merged in: sage-4.3.alpha0
Authors: Alex Ghitza Reviewers: Mike Hansen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

The following code works:

sage: R.<x> = PolynomialRing(QQ)
sage: f = x^2-1
sage: S = R.quotient_by_principal_ideal(f)

but then this fails:

sage: S
 ---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
...[snip]
/Users/tmp/sage-3.4.alpha0/local/lib/python2.5/site-packages/sage/structure/category_object.so in sage.structure.category_object.CategoryObject.variable_names (sage/structure/category_object.c:3530)()

ValueError: variable names have not yet been set using self._assign_names(...)

The routine should require that the name(s) be provided.

Attachments (2)

sage-5482.patch (1.6 KB) - added by Justin Walker 14 years ago.
trac_5482.patch (1.5 KB) - added by Alex Ghitza 13 years ago.
apply this patch only

Download all attachments as: .zip

Change History (11)

Changed 14 years ago by Justin Walker

Attachment: sage-5482.patch added

comment:1 Changed 14 years ago by Justin Walker

Summary: Quotient ring can be created without generator names[With patch; needs review] Quotient ring can be created without generator names

The fix is to require the generator name at creation time, not when the ring is used.

comment:2 Changed 14 years ago by John Cremona

Why do you change the parameter name from "names" to "name"? Is this function only used for univariate polynomial rings? If so, fine.

comment:3 Changed 14 years ago by Michael Abshoff

Milestone: sage-3.4.2

comment:4 Changed 14 years ago by William Stein

Summary: [With patch; needs review] Quotient ring can be created without generator names[With patch; needs work] Quotient ring can be created without generator names

REFEREE REPORT:

  1. It *must* be "names" not "name", so the R.<x> = foo notation works.
  1. Every patch has to have a doctest that illustrates that it fixes the bug.

comment:5 in reply to:  4 Changed 14 years ago by Justin Walker

Owner: changed from William Stein to Justin Walker
Status: newassigned

Replying to was:

REFEREE REPORT:

  1. It *must* be "names" not "name", so the R.<x> = foo notation works.

I discovered that while adding doctests. I'll reverse that change.

  1. Every patch has to have a doctest that illustrates that it fixes the bug.

Doctests?

comment:6 Changed 13 years ago by Alex Ghitza

Component: algebraic geometryalgebra
Summary: [With patch; needs work] Quotient ring can be created without generator namesQuotient ring can be created without generator names

comment:7 Changed 13 years ago by Alex Ghitza

Authors: Alex Ghitza
Status: needs_workneeds_review

I attached a new patch that assigns names automatically if they are not specified by the user, e.g. a quotient of R.<x> will have variable name xbar. This is standard behaviour in other places in Sage.

Apply trac_5482.patch only.

Changed 13 years ago by Alex Ghitza

Attachment: trac_5482.patch added

apply this patch only

comment:8 Changed 13 years ago by Mike Hansen

Reviewers: Mike Hansen
Status: needs_reviewpositive_review

Looks good to me.

comment:9 Changed 13 years ago by Mike Hansen

Merged in: sage-4.3.alpha0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.