Opened 10 years ago

Closed 10 years ago

#9242 closed defect (fixed)

Add docstrings and tests for sage/rings/ideal_monoid.py

Reported by: davidloeffler Owned by: mvngu
Priority: major Milestone: sage-4.5.2
Component: doctest coverage Keywords: docstring, doctest, ideals
Cc: Merged in: sage-4.5.2.alpha1
Authors: David Loeffler Reviewers: Alex Ghitza
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

----------------------------------------------------------------------
ideal_monoid.py
ERROR: Please add a `TestSuite(s).run()` doctest.
SCORE ideal_monoid.py: 0% (0 of 6)

Missing documentation:
         * IdealMonoid(R):
         * __init__(self, R):
         * _repr_(self):
         * ring(self):
         * __call__(self, x):
         * _coerce_impl(self, x):

----------------------------------------------------------------------

Attachments (1)

trac_9242-ideal_monoid_docs.patch (6.2 KB) - added by davidloeffler 10 years ago.
patch against 4.4.4.alpha0

Download all attachments as: .zip

Change History (7)

comment:1 Changed 10 years ago by davidloeffler

  • Milestone set to sage-4.4.5
  • Status changed from new to needs_review

Here's a patch which gets coverage up to 100%, but one TestSuite test fails.

comment:2 Changed 10 years ago by AlexGhitza

  • Status changed from needs_review to needs_work
  • Work issues set to doctest failure

There is a doctest failure in structure/coerce.pyx which is caused by this patch:

sage -t -long "devel/sage/sage/structure/coerce.pyx"        
**********************************************************************
File "/mnt/usb1/scratch/ghitza/sage-4.4.4.alpha0-boxen.math.washington.edu-x86_64-Linux/devel/sage/sage/structure/coerce.pyx", line 357:
    sage: cm.exception_stack()
Expected:
    [(<class 'sage.structure.coerce_exceptions.CoercionException'>, CoercionException("BUG: the base_extend method must be defined for 'Monoid of ideals of Integer Ring' (class '<class 'sage.rings.ideal_monoid.IdealMonoid_c'>')",), <traceback object at ...>), (<type 'exceptions.TypeError'>,  TypeError("no common canonical parent for objects with parents: 'Rational Field' and 'Finite Field of size 3'",),  <traceback object at ...>)]
Got:
    [(<class 'sage.structure.coerce_exceptions.CoercionException'>, CoercionException(AttributeError("'IdealMonoid_c_with_category' object has no attribute 'base_extend'",),), <traceback object at 0x1049ea8>), (<type 'exceptions.TypeError'>, TypeError("no common canonical parent for objects with parents: 'Rational Field' and 'Finite Field of size 3'",), <traceback object at 0x1049c20>)]

I don't know what's going on.

Changed 10 years ago by davidloeffler

patch against 4.4.4.alpha0

comment:3 Changed 10 years ago by davidloeffler

  • Status changed from needs_work to needs_review

It's harmess (if you look, the exception stack is actually identical, just with slightly different string representation for some of the classes). I've uploaded a new patch.

comment:4 Changed 10 years ago by AlexGhitza

  • Authors set to David Loeffler
  • Reviewers set to Alex Ghitza
  • Status changed from needs_review to positive_review
  • Work issues doctest failure deleted

Great. I'm happy with this; the category fix can be on a new ticket.

comment:5 Changed 10 years ago by was

  • Milestone changed from sage-4.4.5 to sage-4.5

Milestone sage-4.4.5 deleted

comment:6 Changed 10 years ago by ddrake

  • Merged in set to sage-4.5.2.alpha1
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.