On 04/26/2010 06:49 AM, David Roe wrote:
Marshall's right that you need to change where the import comes from,
but you actually want
from sage.rings.finite_rings.constructor import FiniteField


Is this a compatibility issue that should have a deprecation period? I wonder how many people it will affect.

I suppose it would be easy to make a dummy finite_field module that imports in the relevant functions so that there could be a deprecation for a while.

Thanks,

Jason





The class in sage.rings.finite_rings.finite_field_base is the base
class, whereas FiniteField in constructor is the UniqueFactory that
makes finite fields.

sage: import sage.rings.finite_field
shouldn't work since that module no longer exists.  If you want similar
functions, use
sage: import sage.rings.finite_rings.constructor
instead.

Finally, if you're having trouble with import errors after upgrading,
it's possible that you need to delete old files in the build directory.
I don't know if this will happen or if upgrade takes care of it for you.
David

On Mon, Apr 26, 2010 at 7:32 AM, mhampton <hampto...@gmail.com
<mailto:hampto...@gmail.com>> wrote:

    A number of tickets such as #8218 refactored quite a bit of finite
    field code.  The FiniteField class you were using can be imported by:

    from sage.rings.finite_rings.finite_field_base import FiniteField

    -Marshall

    On Apr 26, 6:08 am, Simon King <simon.k...@nuigalway.ie
    <mailto:simon.k...@nuigalway.ie>> wrote:
     > Hi!
     >
     > I just upgraded to sage-4.4. I get:
     >
     > sage: from sage.rings.finite_field import FiniteField
     >
    ---------------------------------------------------------------------------
     > ImportError                               Traceback (most recent call
     > last)
     >
     > /home/king/<ipython console> in <module>()
     >
     > /home/king/SAGE/sage-4.3.1/local/lib/python2.6/site-packages/sage/
     > rings/finite_field.py in <module>()
     >     154 import random
     >     155
     > --> 156 from ring import is_FiniteField
     >     157 from sage.structure.parent_gens import normalize_names
     >     158
     >
     > ImportError: cannot import name is_FiniteField
     >
     > and
     >
     > sage: from sage.rings import finite_field_element
     >
    ---------------------------------------------------------------------------
     > ImportError                               Traceback (most recent call
     > last)
     >
     > /home/king/<ipython console> in <module>()
     >
     > /home/king/SAGE/sage-4.3.1/local/lib/python2.6/site-packages/sage/
     > rings/finite_field_element.py in <module>()
     >      35 import rational
     >      36 from sage.libs.pari.all import pari, pari_gen
     > ---> 37 from sage.structure.element import FiniteFieldElement
     >      38 import field_element
     >      39 import integer_mod
     >
     > ImportError: cannot import name FiniteFieldElement
     >
     > Shall I open a ticket? Is there a work-around?
     >
     > Cheers,
     > Simon
     >
     > --
     > To post to this group, send an email to
    sage-devel@googlegroups.com <mailto:sage-devel@googlegroups.com>
     > To unsubscribe from this group, send an email to
    sage-devel+unsubscr...@googlegroups.com
    <mailto:sage-devel%2bunsubscr...@googlegroups.com>
     > For more options, visit this group
    athttp://groups.google.com/group/sage-devel
    <http://groups.google.com/group/sage-devel>
     > URL:http://www.sagemath.org

    --
    To post to this group, send an email to sage-devel@googlegroups.com
    <mailto:sage-devel@googlegroups.com>
    To unsubscribe from this group, send an email to
    sage-devel+unsubscr...@googlegroups.com
    <mailto:sage-devel%2bunsubscr...@googlegroups.com>
    For more options, visit this group at
    http://groups.google.com/group/sage-devel
    URL: http://www.sagemath.org


--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to