New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing docstrings in core #3904

Open
certik opened this Issue Apr 24, 2008 · 12 comments

Comments

Projects
None yet
@certik
Copy link
Member

certik commented Apr 24, 2008

In [5]: x.evalf?
Type:       instancemethod
Base Class: <type 'instancemethod'>
String Form:    <bound method Symbol.evalf of x>
Namespace:  Interactive
File:       /home/ondra/sympy/sympy/core/basic.py
Definition: x.evalf(self, precision=None)
Docstring:
    <no docstring>

In [1]: x.leadterm?
Type:       instancemethod
Base Class: <type 'instancemethod'>
String Form:    <bound method Symbol.leadterm of x>
Namespace:  Interactive
File:       /home/ondra/sympy/sympy/core/basic.py
Definition: x.leadterm(self, x)
Docstring:
    <no docstring>

In [4]: x.nseries?
Type:       instancemethod
Base Class: <type 'instancemethod'>
String Form:    <bound method Symbol.nseries of x>
Namespace:  Interactive
File:       /home/ondra/sympy/sympy/core/basic.py
Definition: x.nseries(self, x, x0, n)
Docstring:
    <no docstring>

In [6]: x.doit?
Type:       instancemethod
Base Class: <type 'instancemethod'>
String Form:    <bound method Symbol.doit of x>
Namespace:  Interactive
File:       /home/ondra/sympy/sympy/core/basic.py
Definition: x.doit(self, **hints)
Docstring:
    <no docstring>

Original issue for #3904: http://code.google.com/p/sympy/issues/detail?id=805

Original author: https://code.google.com/u/104039945248245758823/

@certik

This comment has been minimized.

Copy link
Member

certik commented Apr 23, 2008

I think missing docstring in the x.nseries() is the reason for using _eval_oseries
and _eval_nseries? If so, let's create a new issue for nseries and fix that.

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c1

Original author: https://code.google.com/u/104039945248245758823/

@navytux

This comment has been minimized.

Copy link

navytux commented Apr 23, 2008

Also, no docstrings for
- exp
- log

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c2

Original author: https://code.google.com/u/111152560333599832822/

@certik

This comment has been minimized.

Copy link
Member

certik commented Apr 24, 2008

@rwnobrega

This comment has been minimized.

Copy link
Contributor

rwnobrega commented May 21, 2008

**Labels:** -easy-to-fix EasyToFix  

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c4

Original author: https://code.google.com/u/rwnobrega/

@sympy-issue-migrator

This comment has been minimized.

Copy link

sympy-issue-migrator commented Dec 15, 2009

Good!
Since I am learning more about the code and the core, I will take this one on going,
ok?

Best,

Julio

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c5
Original author: https://code.google.com/u/idichekop@gmail.com/

@sympy-issue-migrator

This comment has been minimized.

Copy link

sympy-issue-migrator commented Dec 15, 2009

Actually, some of the mentioned docstrings exist. 
The problem is that most of these methods are overriden and the override function
has no docstring.  

Should I include then?
In this case, should I indicate it is overriden? 
Is the comment an extension from the base comment, or a repetition plus differences?

Thanks,

Julio

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c6
Original author: https://code.google.com/u/idichekop@gmail.com/

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Mar 20, 2012

@ishanthilina

This comment has been minimized.

Copy link

ishanthilina commented Apr 5, 2012

I think this issue should be marked as resolved now since the docstrings are added to the methods described here (and some above mentioned methods are not available in sympy now)

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c8
Original author: https://code.google.com/u/102756650419101528990/

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented May 20, 2012

But documentation in the core in general is rather abysmal.

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c9
Original author: https://code.google.com/u/asmeurer@gmail.com/

@rajat974

This comment has been minimized.

Copy link
Contributor

rajat974 commented Feb 6, 2014

what is the status of this issue?

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c10
Original author: https://code.google.com/u/109642579028106024672/

@skirpichev

This comment has been minimized.

Copy link
Contributor

skirpichev commented Feb 6, 2014

Hmm, something like this:

In [24]: [method for method in dir(x) if re.match('^[a-z]', method) and getattr(x, method).__doc__ is None]
Out[24]: 
['adjoint',
 'as_base_exp',
 'as_dummy',
 'as_real_imag',
 'class_key',
 'conjugate',
 'copy',
 'diff',
 'doit',
 'is_antihermitian',
 'is_bounded',
 'is_complex',
 'is_composite',
 'is_constant',
 'is_even',
 'is_finite',
 'is_hermitian',
 'is_hypergeometric',
 'is_imaginary',
 'is_infinitesimal',
 'is_integer',
 'is_irrational',
 'is_negative',
 'is_noninteger',
 'is_nonnegative',
 'is_nonpositive',
 'is_nonzero',
 'is_odd',
 'is_polar',
 'is_positive',
 'is_prime',
 'is_rational',
 'is_real',
 'is_unbounded',
 'is_zero',
 'matches',
 'normal',
 'sort_key',
 'transpose',
 'xreplace']

Aaron, could you clarify todo for this issue?

**Cc:** asmeurer@gmail.com  

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c11
Original author: https://code.google.com/u/113518207426301808764/

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Feb 22, 2014

Every public method should have a docstring with doctests. Run ./bin/coverage_doctest.py -v sympy/core to see what's missing.

Original comment: http://code.google.com/p/sympy/issues/detail?id=805#c12
Original author: https://code.google.com/u/asmeurer@gmail.com/

@certik certik added imported labels Mar 7, 2014

@flacjacket flacjacket added Easy to Fix and removed EasyToFix labels Mar 7, 2014

skirpichev added a commit to skirpichev/diofant that referenced this issue Oct 25, 2016

skirpichev added a commit to skirpichev/diofant that referenced this issue Nov 1, 2016

XXX Add missing core docstrings
See sympy/sympy#3904

TODO

In [53]: pcl = [d for d in dir(diofant.core) if not d.startswith('_') and inspect.isclass(eval('diofant.core.'+d))]
In [54]: for c in pcl:
    l = [method for method in dir(eval(c)) if re.match('^[a-z]', method) and getattr(eval(c + '.' + str(method)), '__doc__') is None]
    if l:
        print(c)
        print(l)
        print("-------------")
   ....:
Add
['as_numer_denom', 'getO', 'matches', 'removeO']
-------------
Atom
['class_key', 'doit', 'matches', 'sort_key', 'xreplace']
-------------
AtomicExpr
['class_key', 'doit', 'matches', 'sort_key', 'xreplace']
-------------
Derivative
['doit', 'expr', 'free_symbols', 'variables']
-------------
Dict
['args']
-------------
Dummy
['as_real_imag', 'assumptions0', 'class_key', 'doit', 'free_symbols', 'is_constant', 'matches', 'sort_key', 'xreplace']
-------------
Float
['as_coeff_add', 'as_coeff_mul', 'ceiling', 'class_key', 'doit', 'epsilon_eq', 'floor', 'is_constant', 'matches', 'num', 'sort_key', 'xreplace']
-------------
Function
['class_key', 'func']
-------------
Ge
['gts', 'lts']
-------------
GreaterThan
['gts', 'lts']
-------------
Gt
['gts', 'lts']
-------------
Integer
['as_coeff_add', 'as_coeff_mul', 'as_numer_denom', 'class_key', 'doit', 'gcd', 'is_constant', 'lcm', 'matches', 'sort_key', 'xreplace']
-------------
Lambda
['free_symbols']
-------------
Le
['gts', 'lts']
-------------
LessThan
['gts', 'lts']
-------------
Lt
['gts', 'lts']
-------------
Mod
['class_key', 'eval', 'func']
-------------
Mul
['as_base_exp', 'as_coeff_mul', 'as_numer_denom', 'as_powers_dict', 'as_real_imag', 'matches']
-------------
Number
['as_coeff_add', 'as_coeff_mul', 'class_key', 'doit', 'is_constant', 'matches', 'sort_key', 'xreplace']
-------------
NumberSymbol
['class_key', 'doit', 'matches', 'sort_key', 'xreplace']
-------------
PoleError
['args']
-------------
Pow
['as_numer_denom', 'as_real_imag', 'matches']
-------------
PrecisionExhausted
['args']
-------------
Rational
['as_coeff_add', 'as_coeff_mul', 'as_numer_denom', 'class_key', 'doit', 'gcd', 'is_constant', 'lcm', 'matches', 'sort_key', 'xreplace']
-------------
RealNumber
['as_coeff_add', 'as_coeff_mul', 'ceiling', 'class_key', 'doit', 'epsilon_eq', 'floor', 'is_constant', 'matches', 'num', 'sort_key', 'xreplace']
-------------
StrictGreaterThan
['gts', 'lts']
-------------
StrictLessThan
['gts', 'lts']
-------------
Subs
['doit', 'evalf', 'free_symbols', 'n']
-------------
Symbol
['as_real_imag', 'assumptions0', 'class_key', 'doit', 'free_symbols', 'is_constant', 'matches', 'sort_key', 'xreplace']
-------------
SympifyError
['args']
-------------
Wild
['as_real_imag', 'assumptions0', 'class_key', 'doit', 'free_symbols', 'is_constant', 'matches', 'sort_key', 'xreplace']
-------------
WildFunction
['class_key', 'doit', 'func', 'matches', 'sort_key', 'xreplace']
-------------

skirpichev added a commit to skirpichev/diofant that referenced this issue Nov 2, 2016

Add missing core docstrings
Closes sympy/sympy#3904

Rest of missing docstrings:

In [53]: pcl = [d for d in dir(diofant.core) if not d.startswith('_') and inspect.isclass(eval('diofant.core.'+d))]
In [54]: for c in pcl:
    l = [method for method in dir(eval(c)) if re.match('^[a-z]', method) and getattr(eval(c + '.' + str(method)), '__doc__') is None]
    if l:
        print(c)
        print(l)
        print("-------------")
   ....:
Mod
['eval']
-------------
PoleError
['args']
-------------
PrecisionExhausted
['args']
-------------
SympifyError
['args']
-------------

eval methods - are not documented in diofant/functions too
'args' - from the standard Python library

skirpichev added a commit to skirpichev/diofant that referenced this issue Nov 2, 2016

Add missing core docstrings
Closes sympy/sympy#3904

Rest of missing docstrings:

In [53]: pcl = [d for d in dir(diofant.core) if not d.startswith('_') and inspect.isclass(eval('diofant.core.'+d))]
In [54]: for c in pcl:
    l = [method for method in dir(eval(c)) if re.match('^[a-z]', method) and getattr(eval(c + '.' + str(method)), '__doc__') is None]
    if l:
        print(c)
        print(l)
        print("-------------")
   ....:
Mod
['eval']
-------------
PoleError
['args']
-------------
PrecisionExhausted
['args']
-------------
SympifyError
['args']
-------------

eval methods - are not documented in diofant/functions too
'args' - from the standard Python library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment