Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
2516: fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Apr 13, 2014
1 parent 5a415fb commit ebe4c6a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/sage/functions/hypergeometric.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ def _print_latex_(self, a, b, z):
r"{} \right)").format(len(a), len(b), aa, bb, z)

def _eval_(self, a, b, z, **kwargs):
if not isinstance(a,tuple) or not isinstance(b,tuple):
raise ValueError('First two parameters must be of type list.')
coercion_model = get_coercion_model()
co = reduce(lambda x, y: coercion_model.canonical_coercion(x, y)[0],
a + b + (z,))
Expand All @@ -269,6 +271,8 @@ def _evalf_(self, a, b, z, parent, algorithm=None):
2.7182818284590452353602874714
"""
if not isinstance(a,tuple) or not isinstance(b,tuple):
raise ValueError('First two parameters must be of type list.')
from mpmath import hyper
aa = [rational_param_as_tuple(c) for c in a]
bb = [rational_param_as_tuple(c) for c in b]
Expand Down Expand Up @@ -334,13 +338,14 @@ def _fast_callable_(cls, self, a, b, z, etb):
sage: from sage.ext.fast_callable import ExpressionTreeBuilder
sage: etb = ExpressionTreeBuilder(vars=['x'])
sage: h._fast_callable_(etb)
{CommutativeRings.element_class}(v_0)
{hypergeometric((), (), x)}(v_0)
sage: y = var('y')
sage: fast_callable(hypergeometric([y], [], x),
....: vars=[x, y])(3, 4)
hypergeometric((4,), (), 3)
"""
self.__name__ = self.__repr__() # was clobbered by category mechanics
return etb.call(self, *map(etb.var, etb._vars))

def sorted_parameters(cls, self, a, b, z):
Expand Down
1 change: 1 addition & 0 deletions src/sage/symbolic/expression_conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ def __init__(self, ex, *vars):
vars = ex.variables()

if vars:
from sage.misc.superseded import deprecation
deprecation(5930, "Substitution using function-call syntax and unnamed arguments is deprecated and will be removed from a future release of Sage; you can use named arguments instead, like EXPR(x=..., y=...)")


Expand Down
4 changes: 3 additions & 1 deletion src/sage/symbolic/random_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import sage.calculus.calculus
import sage.symbolic.pynac
from sage.symbolic.constants import *
from sage.functions.hypergeometric import hypergeometric


###################################################################
Expand Down Expand Up @@ -51,7 +52,8 @@ def _mk_full_functions():
return [(1.0, f, f.number_of_arguments())
for (name, f) in items
if hasattr(f, 'number_of_arguments') and
f.number_of_arguments() > 0]
f.number_of_arguments() > 0 and
f <> hypergeometric]

# For creating simple expressions

Expand Down

0 comments on commit ebe4c6a

Please sign in to comment.