Opened 11 years ago

Closed 7 years ago

Last modified 6 years ago

#8790 closed enhancement (fixed)

improve doctest coverage of logic/logic.py

Reported by: mvngu Owned by: mvngu
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: documentation Keywords: beginner doctest documentation
Cc: rws Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by chapoton)

As the subject says. Currently, the coverage of sage/logic/logic.py in Sage 4.4 is:

[mvngu@sage sage-4.4]$ ./sage -coverage devel/sage-main/sage/logic/logic.py 
----------------------------------------------------------------------
devel/sage-main/sage/logic/logic.py
ERROR: Please add a `TestSuite(s).run()` doctest.
SCORE devel/sage-main/sage/logic/logic.py: 16% (3 of 18)

Missing documentation:
 * combine(self, statement1, statement2):   see #15262
 * simplify(self, table):
 * prove(self, statement):


Missing doctests:
 * get_bit(x, c):
 * eval(toks):
 * eval_ltor_toks(lrtoks):
 * reduce_bins(lrtoks):
 * reduce_monos(lrtoks):
 * eval_mon_op(args):
 * eval_bin_op(args):
 * eval_and_op(lval, rval):
 * eval_or_op(lval, rval):
 * eval_ifthen_op(lval, rval):
 * eval_iff_op(lval, rval):
 * tokenize(s, toks):

This needs to be coordinated with #8797.

Attachments (2)

sage-issue-8790-not-implemented.diff (1.5 KB) - added by riccardomurri 8 years ago.
Add docstring to functions combine, simplify and prove.
sage-issue-8790-module-private-funcs.diff (6.0 KB) - added by riccardomurri 8 years ago.
Rename internal functions to start with an underscore

Download all attachments as: .zip

Change History (15)

comment:1 Changed 11 years ago by mvngu

  • Description modified (diff)

comment:2 Changed 8 years ago by knsam

  • Keywords beginner doctest documentation added

comment:3 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

Changed 8 years ago by riccardomurri

Add docstring to functions combine, simplify and prove.

comment:4 Changed 8 years ago by riccardomurri

Functions simplify, combine and prove are actually not implemented: the code is a stub. Patch sage-issue-8790-not-implemented.diff provides a docstring stating that.

I'm not sure how doctests should be provided here: one could probably change the code to raise a NotImplemented exception and look for that in the doctest.

Last edited 8 years ago by riccardomurri (previous) (diff)

Changed 8 years ago by riccardomurri

Rename internal functions to start with an underscore

comment:5 Changed 8 years ago by riccardomurri

The get_bits, eval_*, reduce_* and tokenize functions are explictly described as "for internal use only". It is inconvenient to provide a doctest for them, as arguments are the internal data structures used in the SymbolicLogic class.

Patch sage-issue-8790-module-private-funcs.diff​ renames the functions to begin with an underscore to make their non-public nature more evident, in the hope to silence the coverage warning.

comment:6 Changed 8 years ago by LostPw

fix for the combine function #15262

comment:7 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:8 Changed 7 years ago by rws

  • Cc rws added
  • Description modified (diff)

comment:9 Changed 7 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:10 Changed 7 years ago by aapitzsch

  • Milestone changed from sage-6.3 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

I get

./sage --coverage src/sage/logic/logic.py 
------------------------------------------------------------------------
SCORE src/sage/logic/logic.py: 100.0% (18 of 18)
------------------------------------------------------------------------

comment:11 Changed 7 years ago by rws

  • Status changed from needs_review to positive_review

comment:12 Changed 7 years ago by vbraun

  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:13 Changed 6 years ago by chapoton

  • Description modified (diff)
Note: See TracTickets for help on using tickets.