Sorted it out, I had forgotten to import one file. Sorry for the
noise. Class patches nicely now; I am just having some test failures
due to different orderings of some output sets. Is there a standard
way of implementing tests that involve sets as outputs?

In a related matter, in the _set_ method, is it better to return a
python set or a sage Set?

Cheers
J

On Jan 9, 1:23 pm, javier <vengor...@gmail.com> wrote:
> Hi there,
>
> I am trying to get my code moved to the source files, but am finding
> some problems  (it is my first time!). What I did was:
> - cloning sage to my own branch (called sage-groups),
> - Added a new file $SAGE_ROOT/devel/sage-groups/sage/groups/
> group_conjugacy_class.py with my class code
> - modified  $SAGE_ROOT/devel/sage-groups/sage/groups/group.pyx
> including this in the class Group:
>
> def conjugacy_class(self, g):
>         """
>             This function should go inside the Group class
>
>         INPUT:
>
>         - ``G`` - A group
>
>         - ``g``- An element of G
>
>         OUTPUT:
>
>         - The conjugacy class of g in G (as a ConjugacyClass object)
>
>         EXAMPLES:
>
>         ::
>
>             sage: G = SymmetricGroup(4)
>             sage: g = G((1,2,3,4))
>             sage: conjugacy_class(G,g)
>             Conjugacy class of (1,2,3,4) in Symmetric group of order
> 4! as a permutation group
>
>         """
>         from sage.groups.group_conjugacy_class import ConjugacyClass
> as ConjugacyClass
>         return ConjugacyClass(self,g)
>
> - modified the file all.py in the same folder by adding the line
>
> from group_conjugacy_class import *
>
> - build with sage -b
>
> Then I try to test the code by running sage -t ..../
> group_conjugacy_class.py and I get this:
>
> sage -t  "devel/sage-groups/sage/groups/group_conjugacy_class.py"
> A mysterious error (perhaps a memory error?) occurred, which may have
> crashed doctest.
>          [15.4 s]
> exit code: 768
>
> ----------------------------------------------------------------------
> The following tests failed:
>
>         sage -t  "devel/sage-groups/sage/groups/
> group_conjugacy_class.py"
> Total time for all tests: 15.4 seconds
>
> when I try to start sage I get this error at the new
> group_conjugacy_class.py file
> NameError: name 'cached_method' is not defined
>
> I guess I am doing something stupid or forgetting to do something?
>
> Cheers
> J
-- 
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