Ticket #1267 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

[with patch] documentation for piecewise does not show up in notebook

Reported by: cwitty Owned by: mhansen
Priority: major Milestone: sage-2.9
Component: notebook Keywords:
Cc: Work issues:
Report Upstream: Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

In the public notebook (on www.sagenb.org), when I evaluate a cell with piecewise?, I get this:

File:        /usr/local/sage-2.6/local/lib/python2.5/site-packages/sage/functions/piecewise.py
Type:        <type 'classobj'>
Definition:  piecewise(x0)
Docstring:

with no actual docstring. (Doing the same thing from the command line does give a useful docstring.)

Attachments

1267.patch Download (3.4 KB) - added by mhansen 6 years ago.

Change History

comment:1 Changed 6 years ago by mabshoff

  • Summary changed from documentation for piecewise does not show up in notebook to documentation for piecewise does not work
  • Milestone changed from sage-2.9 to sage-2.8.15

comment:2 Changed 6 years ago by mabshoff

  • Summary changed from documentation for piecewise does not work to documentation for piecewise does not show up in notebook

After some testing it turns out that cwitty is right and it does work in console mode with 2.8.14 So was is wrong and change it back.

comment:3 Changed 6 years ago by was

I can confirm and replicate this problem:

[10:09am] was_: It does fail on my ocally-running notebook.
[10:09am] was_: Ipython does the help on the command line.
[10:09am] was_: *I* wrote what does the help in the notebook.
[10:09am] DenisG_: (my locally running notebook)
[10:09am] was_: It's separate code; I think it is is sage/server/support.py or something like that
[10:10am] was_: And there is definitely a bug.

comment:4 Changed 6 years ago by mhansen

  • Owner changed from boothby to mhansen
  • Status changed from new to assigned
  • Summary changed from documentation for piecewise does not show up in notebook to [with patch] documentation for piecewise does not show up in notebook

Actually, I don't think anything wrong with the ? or ?? notation. What was happening was roughly the following:

class PiecewisePolynomial:
    def __init__(self, list_of_pairs):
        """docstring"""

    ...

piecewise = PiecewisePolynomial

The result of piecewise? was correct since PiecewisePolynomial? didn't have a class docstring.

Changed 6 years ago by mhansen

comment:5 Changed 6 years ago by mabshoff

Looks good to me.

Cheers,

Michael

comment:6 Changed 6 years ago by mabshoff

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

Merged in 2.9.alpha2.

Note: See TracTickets for help on using tickets.