On Jan 25, 2008 8:30 AM, John Cremona <[EMAIL PROTECTED]> wrote:
>
> I'm sure this will have an instant simple answer.
>
> I have added a member function (method) called automorphisms(self) to
> an existing Sage class.  Namely, to the class  EllipticCurve_generic
> -- by inserting code into /sage/schemes/elliptic_curves/ell_generic.py
>
> I then do
>   sage -br
> and all seems well.
>
> But when I run Sage and create an instance of the class, it cannot see
> the new method:
>
> sage: E=EllipticCurve(0);E
> Elliptic Curve defined by y^2  = x^3 +1 over Rational Field
> sage: E.automorphisms()
> ---------------------------------------------------------------------------
> <type 'exceptions.AttributeError'>        Traceback (most recent call last)
>
> /home/jec/sage/<ipython console> in <module>()
>
> <type 'exceptions.AttributeError'>: 'EllipticCurve_rational_field'
> object has no attribute 'automorphisms'
>
> I'm sure that the code for automorphisms() is in the correct scope in the 
> file.
>
> Help!

That makes absolutely no sense, unless you're wrong
when you say:

> I then do
>   sage -br
> and all seems well.

above.  Could you modify ell_generic.py, then do "sage -br" again, and post
the exact output?

>
> John Cremona
>
> PS While I'm here, is there a way of doing "sage -br" without quitting
> Sage -- and losing all the variables etc that one has been testing
> with?

No.    But you might find the save_session command useful, especially because
there is persistent history between sessions:

sage: a = 5
sage: e = EllipticCurve([1..5])
sage: save_session('foo')
sage:
Exiting SAGE (CPU time 0m0.12s, Wall time 0m27.67s).
teragon:vishigher was$ sage
----------------------------------------------------------------------
| SAGE Version 2.10, Release Date: 2008-01-18                        |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------

sage: load_session('foo')
sage: e
Elliptic Curve defined by y^2 + x*y + 3*y = x^3 + 2*x^2 + 4*x + 5 over
Rational Field



 -- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to