Ticket #3451 (closed defect: fixed)

Opened 5 months ago

Last modified 3 months ago

[with patch, with positive review] inaccurate error message in scheme morphisms

Reported by: moretti Assigned to: AlexGhitza
Priority: trivial Milestone: sage-3.1.2
Component: algebraic geometry Keywords: affine, scheme, morphism
Cc: AlexGhitza

Description

R.<x,y> = QQ[]
A = AffineSpace(R)
H = A.Hom(A)
f = H([x-y, x*y])
f([0,1])
Traceback (click to the left for traceback)
...
TypeError: x (=[0, 1]) must be a projective point given by coordinates

When of course the error message should say that x must be an affine point...

The fix would be trivial, but would it be acceptable to make scheme morphisms try converting their input to elements of their domain, first, so that the above would not raise an error?

Attachments

3451_scheme_morphism.patch (1.8 kB) - added by AlexGhitza on 08/27/2008 01:54:33 AM.

Change History

08/26/2008 04:10:39 AM changed by AlexGhitza

  • cc set to AlexGhitza.

08/27/2008 01:54:33 AM changed by AlexGhitza

  • attachment 3451_scheme_morphism.patch added.

08/27/2008 01:55:08 AM changed by AlexGhitza

  • summary changed from inaccurate error message in scheme morphisms to [with patch, needs review] inaccurate error message in scheme morphisms.

I have changed things in the following way: if we try to evaluate f(p), then the first step is to coerce p into the domain of f. If that works, then the evaluation goes forth. Otherwise, there is of course an error message saying that p has no business being there in the first place.

The change is in the generic scheme morphism code, so it should work for affine spaces, projective spaces, and whatever else inherits from schemes.

09/01/2008 02:15:23 AM changed by AlexGhitza

  • owner changed from moretti to AlexGhitza.

09/01/2008 03:04:03 AM changed by AlexGhitza

  • status changed from new to assigned.

09/01/2008 12:50:22 PM changed by cremona

  • summary changed from [with patch, needs review] inaccurate error message in scheme morphisms to [with patch, with positive review] inaccurate error message in scheme morphisms.

Looks ok to me. I see that you are relying on whatever error message is produced by "dom(x)" in case x cannot be coerced into dom rather than supplying your own, of the form "... cannot be coerced into the domain", but that is ok.

Patch applies cleanly to 3.1.2.alpha3 and all doctests in sage.schemes.generic pass.

09/02/2008 04:46:39 AM changed by mabshoff

  • status changed from assigned to closed.
  • resolution set to fixed.

Merged in Sage 3.1.2.alpha4