Commit Graph

121 Commits

Author SHA1 Message Date
Sergey B Kirpichev c44efa2ca2 Remove py2 remnants (cast round() to int) 2026-07-01 08:08:19 +03:00
Sergey B Kirpichev 2a2de4e7ca Drop mp.THETA_Q_LIM 2026-06-29 03:19:33 +03:00
Ayush Baranwal e10416f997 Raise ValueError when same sign at interval boundaries in bisection rootfinding algorithm (#1092) 2026-06-02 11:12:23 +03:00
Sergey B Kirpichev 3a454f6643 Use asc=True per default for polynomial functions 2026-03-04 07:28:50 +03:00
Sergey B Kirpichev e95bf2a22a Fix some found formatting issues with docs 2026-02-22 07:42:46 +03:00
Sergey B Kirpichev 1ad7c87381 Fix "citation not referenced" warnings
Closes #979
2025-08-06 07:15:09 +03:00
Sergey B Kirpichev 2a89521f0d Fix typo (im -> conj)
Closes #987
2025-08-06 05:26:42 +03:00
Hongren Zheng 9ac078ca7c Add Fox H-function with rational A and B parameters (#982)
Closes #980
2025-07-27 19:03:23 +03:00
Sergey B Kirpichev 2cad89428e Move references to docs/references.rst
Closes #224
2025-06-18 18:03:46 +03:00
Sergey B Kirpichev 8778568951 Avoid using ";" in doctests, esp with side effects
The new CPython repl hide all output, except for the last statement.
See https://github.com/python/cpython/issues/131217.
2025-05-01 10:41:48 +03:00
Sergey B Kirpichev 4edff338a2 Add exp2() and log2()
Closes #947
2025-04-26 19:10:40 +03:00
Sergey B Kirpichev d0ca1a9154 Use ellipsis in fp.spherharm doctest
After python/cpython#121149 this was broken on CPython 3.14:

_______________ [doctest] mpmath.functions.orthogonal.spherharm ____________
EXAMPLE LOCATION UNKNOWN, not showing all tests of that example
??? >>> fp.chop(fp.quad(lambda t,p: Y1(t,p)*Y2(t,p)*dS(t,p), *sphere))
Expected:
    1.0000000000000007
Got:
    1.0000000000000004

This particular failure could be fixed by:
diff --git a/mpmath/ctx_base.py b/mpmath/ctx_base.py
index 3309bfa..2ca2fac 100644
--- a/mpmath/ctx_base.py
+++ b/mpmath/ctx_base.py
@@ -110,7 +110,8 @@ def fdot(ctx, xs, ys=None, conjugate=False):
             cf = ctx.conj
             return sum((x*cf(y) for (x,y) in xs), ctx.zero)
         else:
-            return sum((x*y for (x,y) in xs), ctx.zero)
+            return ctx.mpc(sum(((x*y).real for (x,y) in xs), ctx.zero),
+                           sum(((x*y).imag for (x,y) in xs), ctx.zero))

     def fprod(ctx, args):
         prod = ctx.one

But this is just one case for the whole test suite...
2024-08-02 09:45:32 +03:00
Sergey B Kirpichev 5a155f8e09 Drop sign from nstr(mpf('inf')) output
Closes #827
2024-08-01 12:27:58 +03:00
Sergey B Kirpichev 23606c69c3 Deprecate current (descending) order of coefficients in polyval(), etc
Affected functions: chebyfit(), polyval(), polyroots() and findpoly().

First step for #142

Please adapt your code to use asc=True (lowest degree - first) order of
polynomial coefficients.  This will be a new default for mpmath releases
*after* the next release, v1.4.
2024-04-06 11:12:36 +03:00
Sergey B Kirpichev 2f19dae16d Document that gegenbauer() actually implements the Gegenbauer function
See https://dlmf.nist.gov/15.9#iii

Closes #461
Closes #494
2024-02-02 12:56:24 +03:00
Paul Masson 962e1d2e6e Correct Dirichlet eta function definition 2023-12-30 19:04:51 -08:00
Sergey B Kirpichev 0806b14b21 Expose lower/upper_gamma functions
Closes #738
2023-12-01 07:12:36 +03:00
Sergey B Kirpichev 21f791e4b6 Add `plus` flag to select the B_1 sign convention for bernoulli/bernfrac 2023-10-07 09:45:21 +03:00
Parcly Taxel 9a2863abe6 Change bernoulli(1) to +1/2
This commit is part of the project at
https://github.com/sympy/sympy/pull/23926

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>

Adapted from #639
2023-10-07 09:44:52 +03:00
Sergey B Kirpichev 5ec9d07dee Reorganize imports in doctests (no star imports) 2023-05-09 07:27:20 +03:00
Sergey B Kirpichev 945ca7c281 Add doctest:+ELLIPSIS 2023-04-30 08:54:49 +03:00
Sergey B Kirpichev 2ff65f5492 Drop useless doctest: +IGNORE_EXCEPTION_DETAIL (default) 2023-04-30 08:54:20 +03:00
Sergey B Kirpichev 0c1a5d4f44 Fix sphinx warnings with nitpicky=True
Closes #627
2023-04-30 08:54:20 +03:00
Sergey B Kirpichev 57efbdc101 Drop resetting globals (mp.prec and so on) in doctests 2023-04-20 12:55:47 +03:00
Sergey B Kirpichev 31381da358 Run CI tests with pytest-xdist
conftest.py moved to enable reset_mp_globals() fixture for doctests

Closes #99
2023-04-20 11:23:45 +03:00
Fredrik Johansson 1258e33e16 fix failing doctests 2022-11-07 11:27:20 +01:00
Fredrik Johansson b7c15d668c include signals documentation; remove duplicate docstrings 2022-11-07 10:43:28 +01:00
Deyan Mihaylov 7cd161aef0 Add wrappers and fix documentation 2022-08-22 02:30:21 +02:00
Sergey B Kirpichev 4a2a320efc Add missing references
Note, that this changes sphinx docs for some constants.  Unfortunately,
there is no other way to display verbose docstrings for pi and euler.
2021-03-27 01:14:07 +03:00
Paul Masson 4fc6783ade Modify period of cn 2020-01-01 15:58:07 -08:00
Paul Masson c7151a450c Update link 2019-11-22 16:16:25 -08:00
Sergey B Kirpichev ef7597994d Return passed in function in defun* decorators
This turn on more doctests, e.g.:

$ py.test mpmath/functions/qfunctions.py
============================= test session starts ==============================
platform linux -- Python 3.7.1, pytest-4.2.0, py-1.7.0, pluggy-0.8.1
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/sk/src/mpmath/.hypothesis/examples')
rootdir: /home/sk/src/mpmath, inifile: setup.cfg
plugins: xdist-1.26.1, timeout-1.3.3, forked-1.0.1, cov-2.6.1, hypothesis-4.4.3
collected 4 items

mpmath/functions/qfunctions.py ....                                      [100%]

=========================== 4 passed in 0.49 seconds ===========================

Some doctests were adapted.
2019-02-03 21:14:43 +03:00
fredrik 0a006fe83c implement log1p (issue #420) 2018-12-03 20:47:43 +01:00
fredrik 5d3896fc8b fix the doctests 2018-10-15 00:36:04 +02:00
fredrik 7bd9952391 fix a doctest 2018-10-07 23:57:49 +02:00
Fredrik Johansson 220c41cbed Merge pull request #362 from paulmasson/patch-6
Clarify documentaton for re() and im()
2017-09-10 19:27:57 +02:00
Fredrik Johansson 2bd8e6b816 Merge remote-tracking branch 'origin/master' 2017-09-10 19:25:59 +02:00
Fredrik Johansson 9bcd6d4b73 change convention for parameter elimination in hyper() and add some more doctest examples 2017-09-10 19:25:32 +02:00
Paul Masson 9261b84fd8 Clarify re and im 2017-07-02 15:48:41 -07:00
Paul Masson a7548dae8c Grammar correction 2017-04-18 13:53:19 -07:00
Sergey B Kirpichev affc2ef6e1 PEP 8 fixes:
E101 - mix of tabs and spaces
 W191 - use of tabs
 W291 - trailing whitespace
 W293 - trailing whitespace
 E111 - 4 spaces per indentation level
 E112 - 4 spaces per indentation level
 E113 - 4 spaces per indentation level
 W292 - no newline at end of file
 W391 - blank line at end of file

see http://pep8.readthedocs.org/
2014-11-21 17:08:07 +03:00
Gert-Ludwig Ingold 452cca3cd3 DOC: corrected missing word 2014-08-24 14:59:12 +02:00
Fredrik Johansson 63b247c5cf fix a bunch of doctests 2012-12-31 00:41:44 +01:00
Fredrik Johansson b597356632 some basic code for Stirling numbers 2012-12-30 22:54:54 +01:00
Fredrik Johansson 3296b4a241 fix broken links in documentation (issue 206, patch submitted by gdrummo...@gmail.com) 2011-03-23 00:00:25 +00:00
Fredrik Johansson 277d542cd1 simple doctest update 2011-02-01 20:29:05 +00:00
Fredrik Johansson 66e813286b fix some py3 doctest failures 2011-01-28 20:37:56 +00:00
Fredrik Johansson 0f6ac516fa fix most doctests failing in py3 2011-01-09 17:47:36 +00:00
Fredrik Johansson 8faca262e4 Implement the Lerch transcendent; tidy some documentation 2010-11-25 13:01:11 +00:00
Fredrik Johansson e00125e099 improvements to zeta Euler-Maclaurin code
+ Refactor into smaller functions
+ Implement precision adaptivity (handling large cancellation for negative Re(s))
+ Increment N on each iteration to improve performance in some cases
2010-11-22 17:31:24 +00:00