test_pcf.py 664 B

123456789101112131415161718192021222324
  1. """Tests for parabolic cylinder functions.
  2. """
  3. import numpy as np
  4. from numpy.testing import assert_allclose, assert_equal
  5. import scipy.special as sc
  6. def test_pbwa_segfault():
  7. # Regression test for https://github.com/scipy/scipy/issues/6208.
  8. #
  9. # Data generated by mpmath.
  10. #
  11. w = 1.02276567211316867161
  12. wp = -0.48887053372346189882
  13. assert_allclose(sc.pbwa(0, 0), (w, wp), rtol=1e-13, atol=0)
  14. def test_pbwa_nan():
  15. # Check that NaN's are returned outside of the range in which the
  16. # implementation is accurate.
  17. pts = [(-6, -6), (-6, 6), (6, -6), (6, 6)]
  18. for p in pts:
  19. assert_equal(sc.pbwa(*p), (np.nan, np.nan))