On Fri, Aug 26, 2011 at 05:00:10PM -0700, Anne Schilling wrote:
> Hi Nicolas,
> 
> >Quick comments:
> 
> Thanks again for your comments. I incorporated all of them except for the 
> following issue
> which I do not know how to resolve:
> 
> >  - in the doctests of the two __init__:
> >     - Use TestSuite(c).run() rather than the loads/dumps thingy
> >     - add:
> >         sage: c
> >     [2, 1]
> >     sage: type(c)
> >     ...
> 
> I implemented a parent method for Core, but the TestSuite still does not pass:
> 
> sage: c = Core([2,1],4)
> sage: TestSuite(c).run()
> Failure in _test_category:
> Traceback (most recent call last):
>   File 
> "/Applications/sage/local/lib/python2.6/site-packages/sage/misc/sage_unittest.py",
>  line 275, in run
>     test_method(tester = tester)
>   File "element.pyx", line 495, in 
> sage.structure.element.Element._test_category (sage/structure/element.c:3864)
>   File "/Applications/sage/local/lib/python/unittest.py", line 325, in 
> failUnless
>     if not expr: raise self.failureException, msg
> AssertionError
> ------------------------------------------------------------
> The following tests failed: _test_category

How does the testsuite pass on the parent?

Ah, I see. Recall that Cores().element_class is almost the same thing
as Core, but with category classes plugged in. So, in the type call
for Core.__classcall__, you probably want to replace cls by
Cores().element_class. Or alternatively, to replace it by a call to
Cores()(...) to create the core.

> In particular, a core does not think it lives in its parent:
> 
> sage: c in c.parent()
> False

You probably need to implement contains. I somehow would have expected
that their would be a default implementation for that, but I don't
remember from the top of my head.

> I am not sure what I need to do to fix this. Tableaux for example do not even 
> have parents!

They do:

    sage: t = Tableau([[2,1],[3]])
    sage: t.parent()
    Tableaux
    sage: t in Tableaux()
    True
    sage: TestSuite(t).run()

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to