Skip to content

Commit a2f2cba

Browse files
committed
Add docstring to a new function and update CHANGES
1 parent 2a3fb4f commit a2f2cba

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

CHANGES.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ Mathics scanner exceptions of class TranslateError are incompatible
1818
with previous versions, and now store error parameters, "name", "tag", and
1919
"args".
2020

21+
WMA Compatibility
22+
-----------------
23+
24+
Hypergeometric functions have been revised to conform better to WMA behavior by
25+
expanding hypergeometric results.
26+
27+
Bugs
28+
----
29+
30+
* Fixed #1187
31+
32+
33+
2134
8.0.1
2235
-----
2336

mathics/eval/specialfns/hypergeom.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def eval_Hypergeometric1F1(a, b, z):
3333
)
3434
expanded_result = sympy.hyperexpand(sympy_result)
3535

36-
# Oddly, expansion sometimes doesn't work for when complex arguments are given.
36+
# Oddly, SymPy expansion sometimes doesn't work when complex arguments are given.
3737
# However mpmath can handle this.
3838
# I imagine at some point in the future this will be fixed.
3939
if isinstance(expanded_result, sympy.hyper) and all_numeric:
@@ -80,7 +80,7 @@ def eval_Hypergeometric2F1(a, b, c, z):
8080
mpmath.hyp2f1, *cast(Sequence[Number], args), prec=prec
8181
)
8282
else:
83-
return run_sympy_hyper(
83+
return run_sympy_hyper_and_expand(
8484
[sympy_args[0], sympy_args[1]], [sympy_args[2]], sympy_args[3]
8585
)
8686

@@ -90,7 +90,7 @@ def eval_HypergeometricPQF(a, b, z):
9090
try:
9191
a_sympy = [e.to_sympy() for e in a]
9292
b_sympy = [e.to_sympy() for e in b]
93-
return run_sympy_hyper(a_sympy, b_sympy, z.to_sympy())
93+
return run_sympy_hyper_and_expand(a_sympy, b_sympy, z.to_sympy())
9494
except Exception:
9595
return None
9696

@@ -143,7 +143,8 @@ def eval_MeijerG(a, b, z):
143143
# return None
144144

145145

146-
def run_sympy_hyper(a, b, z):
146+
def run_sympy_hyper_and_expand(a, b, z):
147+
"""Ruy SymPy's hyper function and expand the result."""
147148
sympy_result = tracing.run_sympy(sympy.hyper, a, b, z)
148149
result = sympy.hyperexpand(sympy_result)
149150
return from_sympy(result)

0 commit comments

Comments
 (0)