Doc(Typing): Typing function return MO
This commit is contained in:
parent
3a89bcd24f
commit
298093d97d
@ -21,7 +21,7 @@ add_doc = """ Add MOs
|
|||||||
|
|
||||||
:param left: left MO
|
:param left: left MO
|
||||||
:param right: right MO
|
:param right: right MO
|
||||||
:returns: Tree or MO
|
:returns: MO
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ divide_doc = """ Typing trees a divide root
|
|||||||
|
|
||||||
:param left: left MO
|
:param left: left MO
|
||||||
:param right: right MO
|
:param right: right MO
|
||||||
:returns: Tree or MO
|
:returns: MO
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ multiply_doc = """ Multiply MOs
|
|||||||
|
|
||||||
:param left: left MO
|
:param left: left MO
|
||||||
:param right: right MO
|
:param right: right MO
|
||||||
:returns: Tree or MO
|
:returns: MO
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -60,12 +60,8 @@ def moscalar_mostrpower(left, right):
|
|||||||
|
|
||||||
>>> a = MOnumber(4)
|
>>> a = MOnumber(4)
|
||||||
>>> x = MOstrPower('x', 4)
|
>>> x = MOstrPower('x', 4)
|
||||||
>>> print(multiply(a, x))
|
>>> multiply(a, x)
|
||||||
*
|
<MOMonomial 4x^4>
|
||||||
> 4
|
|
||||||
> ^
|
|
||||||
| > x
|
|
||||||
| > 4
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return MOMonomial(left, right)
|
return MOMonomial(left, right)
|
||||||
@ -76,12 +72,8 @@ def mostrpower_moscalar(left, right):
|
|||||||
|
|
||||||
>>> a = MOnumber(4)
|
>>> a = MOnumber(4)
|
||||||
>>> x = MOstrPower('x', 4)
|
>>> x = MOstrPower('x', 4)
|
||||||
>>> print(multiply(x, a))
|
>>> multiply(x, a)
|
||||||
*
|
<MOMonomial 4x^4>
|
||||||
> 4
|
|
||||||
> ^
|
|
||||||
| > x
|
|
||||||
| > 4
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return MOMonomial(right, left)
|
return MOMonomial(right, left)
|
||||||
|
@ -19,14 +19,14 @@ power_doc = """ Typing Power of MOs
|
|||||||
|
|
||||||
:param left: left MO
|
:param left: left MO
|
||||||
:param right: right MO
|
:param right: right MO
|
||||||
:returns: Tree or MO
|
:returns: MO
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
power = Dispatcher("power", doc=power_doc)
|
power = Dispatcher("power", doc=power_doc)
|
||||||
|
|
||||||
@power.register(MOstr, MOnumber)
|
@power.register(MOstr, MOnumber)
|
||||||
def monumber_monumber(left, right):
|
def mostr_monumber(left, right):
|
||||||
""" Create MOstrPower over powered MOstr
|
""" Create MOstrPower over powered MOstr
|
||||||
|
|
||||||
>>> a = MOstr("x")
|
>>> a = MOstr("x")
|
||||||
|
Loading…
Reference in New Issue
Block a user