DedalusProject / dedalus

A flexible framework for solving PDEs with modern spectral methods.
http://dedalus-project.org/
GNU General Public License v3.0
504 stars 119 forks source link

Tests fail after installation via conda #133

Closed ketch closed 3 years ago

ketch commented 3 years ago

I followed the instructions at https://dedalus-project.readthedocs.io/en/latest/pages/installation.html#conda-installation-recommended

When I do "python3 -m dedalus test" I get 3 failing tests:

FAILED opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_bvp.py::test_gaussian_free[Hermite-128-float64]
FAILED opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_bvp.py::test_gaussian_free[Hermite-128-complex128]
FAILED opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_evp.py::test_qho_dense_evp[Hermite-128-complex128]

I am running on a Mac, OS 10.14.6. Here is the full output:

(dedalus) ~ » python3 -m dedalus test
===================================== test session starts =====================================
platform darwin -- Python 3.8.8, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
benchmark: 3.2.3 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /Users/ketch
plugins: cov-2.11.1, benchmark-3.2.3
collected 201 items

opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_bvp.py ..... [  2%]
...........................FF..........................                                 [ 29%]
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_evp.py ..... [ 32%]
..F....                                                                                 [ 35%]
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_ivp.py ..... [ 38%]
...........................................                                             [ 59%]
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_matsolvers.py s [ 60%]
..s...ss...s..s...ss...s..s...ss..xs..s...ss...s..s...ss...s..s...ss..x                 [ 95%]
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_nlbvp.py ... [ 97%]
.....                                                                                   [ 99%]
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_output.py .  [100%]

========================================== FAILURES ===========================================
___________________________ test_gaussian_free[Hermite-128-float64] ___________________________

benchmark = None, x_basis_class = <class 'dedalus.core.basis.Hermite'>, Nx = 128
dtype = <class 'numpy.float64'>

    @pytest.mark.parametrize('dtype', [np.float64, np.complex128])
    @pytest.mark.parametrize('Nx', [128])
    @pytest.mark.parametrize('x_basis_class', [de.Hermite, DoubleLaguerre, LCCL])
    @bench_wrapper
    def test_gaussian_free(benchmark, x_basis_class, Nx, dtype):
        # Stretch Laguerres
        if x_basis_class is de.Hermite:
            stretch = 1.0
        else:
            stretch = 0.1
        # Bases and domain
        x_basis = x_basis_class('x', Nx, center=0, stretch=stretch)
        domain = de.Domain([x_basis], grid_dtype=dtype)
        # Problem
        problem = de.LBVP(domain, variables=['u'])
        problem.parameters['pi'] = np.pi
        problem.add_equation("dx(u) + 2*x*u = 0", tau=True)
        problem.add_bc("integ(u) = sqrt(pi)")
        # Solver
>       solver = problem.build_solver()

opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_bvp.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/problems.py:313: in build_solver
    return self.solver_class(self, *args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/solvers.py:191: in __init__
    pencil.build_matrices(self.pencils, problem, ['L'])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/pencil.py:62: in build_matrices
    expr.operator_dict(test_index, vars, cacheid=cacheid, **problem.ncc_kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/operators.py:440: in operator_dict
    op1 = self.args[1].operator_dict(index, vars, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/operators.py:719: in operator_dict
    op0 = self.args[0].as_ncc_operator(frozen_arg1_basis_meta, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/future.py:208: in as_ncc_operator
    return ncc.as_ncc_operator(frozen_arg_basis_meta, cutoff, max_terms, cacheid=None)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:289: in as_ncc_operator
    return ncc.as_ncc_operator(frozen_arg_basis_meta, cutoff, max_terms, cacheid=None)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:556: in as_ncc_operator
    self.require_coeff_space()
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:440: in require_coeff_space
    self.towards_coeff_space()
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:423: in towards_coeff_space
    self.domain.dist.paths[index-1].decrement([self])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/distributor.py:372: in decrement
    self.decrement_single(*fields)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/distributor.py:357: in decrement_single
    self.basis.forward(gdata, cdata, self.axis, field.meta[self.axis], field.scales[self.axis])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/basis.py:1090: in _forward_mmt
    forward_mat, _ = self._mmt_setup(gdata.shape[axis], cdata.shape[axis], meta['envelope'])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/basis.py:1081: in _mmt_setup
    N2 = np.sqrt(np.pi) * 2**n * special.factorial(n, exact=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

n = array([[  0.],
       [  1.],
       [  2.],
       [  3.],
       [  4.],
       [  5.],
       [  6.],
       [  7.]...     [121.],
       [122.],
       [123.],
       [124.],
       [125.],
       [126.],
       [127.]], dtype=float128)
exact = True

    def factorial(n, exact=False):
        """
        The factorial of a number or array of numbers.

        The factorial of non-negative integer `n` is the product of all
        positive integers less than or equal to `n`::

            n! = n * (n - 1) * (n - 2) * ... * 1

        Parameters
        ----------
        n : int or array_like of ints
            Input values.  If ``n < 0``, the return value is 0.
        exact : bool, optional
            If True, calculate the answer exactly using long integer arithmetic.
            If False, result is approximated in floating point rapidly using the
            `gamma` function.
            Default is False.

        Returns
        -------
        nf : float or int or ndarray
            Factorial of `n`, as integer or float depending on `exact`.

        Notes
        -----
        For arrays with ``exact=True``, the factorial is computed only once, for
        the largest input, with each other result computed in the process.
        The output dtype is increased to ``int64`` or ``object`` if necessary.

        With ``exact=False`` the factorial is approximated using the gamma
        function:

        .. math:: n! = \\Gamma(n+1)

        Examples
        --------
        >>> from scipy.special import factorial
        >>> arr = np.array([3, 4, 5])
        >>> factorial(arr, exact=False)
        array([   6.,   24.,  120.])
        >>> factorial(arr, exact=True)
        array([  6,  24, 120])
        >>> factorial(5, exact=True)
        120

        """
        if exact:
            if np.ndim(n) == 0:
                if np.isnan(n):
                    return n
                return 0 if n < 0 else math.factorial(n)
            else:
                n = asarray(n)
                un = np.unique(n).astype(object)

                # Convert to object array of long ints if np.int_ can't handle size
                if np.isnan(n).any():
                    dt = float
                elif un[-1] > 20:
                    dt = object
                elif un[-1] > 12:
                    dt = np.int64
                else:
                    dt = np.int_

                out = np.empty_like(n, dtype=dt)

                # Handle invalid/trivial values
                # Ignore runtime warning when less operator used w/np.nan
                with np.errstate(all='ignore'):
                    un = un[un > 1]
                    out[n < 2] = 1
                    out[n < 0] = 0

                # Calculate products of each range of numbers
                if un.size:
>                   val = math.factorial(un[0])
E                   TypeError: 'numpy.float128' object cannot be interpreted as an integer

opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/scipy/special/_basic.py:2352: TypeError
-------------------------------------- Captured log call --------------------------------------
DEBUG    domain:domain.py:55 Global coeff shape: [128]
DEBUG    distributor:distributor.py:92 Mesh: []
DEBUG    problems:problems.py:127 Parsing Eqn 0
DEBUG    problems:problems.py:146   Condition: True
DEBUG    problems:problems.py:147   LHS string form: dx(u) + 2*x*u
DEBUG    problems:problems.py:148   RHS string form: 0
DEBUG    problems:problems.py:155   LHS object form: dx(u) + ((2*x)*u)
DEBUG    problems:problems.py:156   RHS object form: 0
DEBUG    problems:problems.py:308   L linear form: dx(u) + ((2*x)*u)
DEBUG    problems:problems.py:127 Parsing Eqn 1
DEBUG    problems:problems.py:146   Condition: True
DEBUG    problems:problems.py:147   LHS string form: integ(u)
DEBUG    problems:problems.py:148   RHS string form: sqrt(pi)
DEBUG    problems:problems.py:155   LHS object form: integ_x(u)
DEBUG    problems:problems.py:156   RHS object form: sqrt(pi)
DEBUG    problems:problems.py:308   L linear form: integ_x(u)
DEBUG    solvers:solvers.py:180 Beginning LBVP instantiation
DEBUG    basis:basis.py:1064 Building Hermite MMT matrices for (gsize, csize, env) = (128, 128, False)
_________________________ test_gaussian_free[Hermite-128-complex128] __________________________

benchmark = None, x_basis_class = <class 'dedalus.core.basis.Hermite'>, Nx = 128
dtype = <class 'numpy.complex128'>

    @pytest.mark.parametrize('dtype', [np.float64, np.complex128])
    @pytest.mark.parametrize('Nx', [128])
    @pytest.mark.parametrize('x_basis_class', [de.Hermite, DoubleLaguerre, LCCL])
    @bench_wrapper
    def test_gaussian_free(benchmark, x_basis_class, Nx, dtype):
        # Stretch Laguerres
        if x_basis_class is de.Hermite:
            stretch = 1.0
        else:
            stretch = 0.1
        # Bases and domain
        x_basis = x_basis_class('x', Nx, center=0, stretch=stretch)
        domain = de.Domain([x_basis], grid_dtype=dtype)
        # Problem
        problem = de.LBVP(domain, variables=['u'])
        problem.parameters['pi'] = np.pi
        problem.add_equation("dx(u) + 2*x*u = 0", tau=True)
        problem.add_bc("integ(u) = sqrt(pi)")
        # Solver
>       solver = problem.build_solver()

opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_bvp.py:180:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/problems.py:313: in build_solver
    return self.solver_class(self, *args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/solvers.py:191: in __init__
    pencil.build_matrices(self.pencils, problem, ['L'])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/pencil.py:62: in build_matrices
    expr.operator_dict(test_index, vars, cacheid=cacheid, **problem.ncc_kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/operators.py:440: in operator_dict
    op1 = self.args[1].operator_dict(index, vars, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/operators.py:719: in operator_dict
    op0 = self.args[0].as_ncc_operator(frozen_arg1_basis_meta, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/future.py:208: in as_ncc_operator
    return ncc.as_ncc_operator(frozen_arg_basis_meta, cutoff, max_terms, cacheid=None)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:289: in as_ncc_operator
    return ncc.as_ncc_operator(frozen_arg_basis_meta, cutoff, max_terms, cacheid=None)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:556: in as_ncc_operator
    self.require_coeff_space()
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:440: in require_coeff_space
    self.towards_coeff_space()
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:423: in towards_coeff_space
    self.domain.dist.paths[index-1].decrement([self])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/distributor.py:372: in decrement
    self.decrement_single(*fields)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/distributor.py:357: in decrement_single
    self.basis.forward(gdata, cdata, self.axis, field.meta[self.axis], field.scales[self.axis])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/basis.py:1090: in _forward_mmt
    forward_mat, _ = self._mmt_setup(gdata.shape[axis], cdata.shape[axis], meta['envelope'])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/basis.py:1081: in _mmt_setup
    N2 = np.sqrt(np.pi) * 2**n * special.factorial(n, exact=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

n = array([[  0.],
       [  1.],
       [  2.],
       [  3.],
       [  4.],
       [  5.],
       [  6.],
       [  7.]...     [121.],
       [122.],
       [123.],
       [124.],
       [125.],
       [126.],
       [127.]], dtype=float128)
exact = True

    def factorial(n, exact=False):
        """
        The factorial of a number or array of numbers.

        The factorial of non-negative integer `n` is the product of all
        positive integers less than or equal to `n`::

            n! = n * (n - 1) * (n - 2) * ... * 1

        Parameters
        ----------
        n : int or array_like of ints
            Input values.  If ``n < 0``, the return value is 0.
        exact : bool, optional
            If True, calculate the answer exactly using long integer arithmetic.
            If False, result is approximated in floating point rapidly using the
            `gamma` function.
            Default is False.

        Returns
        -------
        nf : float or int or ndarray
            Factorial of `n`, as integer or float depending on `exact`.

        Notes
        -----
        For arrays with ``exact=True``, the factorial is computed only once, for
        the largest input, with each other result computed in the process.
        The output dtype is increased to ``int64`` or ``object`` if necessary.

        With ``exact=False`` the factorial is approximated using the gamma
        function:

        .. math:: n! = \\Gamma(n+1)

        Examples
        --------
        >>> from scipy.special import factorial
        >>> arr = np.array([3, 4, 5])
        >>> factorial(arr, exact=False)
        array([   6.,   24.,  120.])
        >>> factorial(arr, exact=True)
        array([  6,  24, 120])
        >>> factorial(5, exact=True)
        120

        """
        if exact:
            if np.ndim(n) == 0:
                if np.isnan(n):
                    return n
                return 0 if n < 0 else math.factorial(n)
            else:
                n = asarray(n)
                un = np.unique(n).astype(object)

                # Convert to object array of long ints if np.int_ can't handle size
                if np.isnan(n).any():
                    dt = float
                elif un[-1] > 20:
                    dt = object
                elif un[-1] > 12:
                    dt = np.int64
                else:
                    dt = np.int_

                out = np.empty_like(n, dtype=dt)

                # Handle invalid/trivial values
                # Ignore runtime warning when less operator used w/np.nan
                with np.errstate(all='ignore'):
                    un = un[un > 1]
                    out[n < 2] = 1
                    out[n < 0] = 0

                # Calculate products of each range of numbers
                if un.size:
>                   val = math.factorial(un[0])
E                   TypeError: 'numpy.float128' object cannot be interpreted as an integer

opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/scipy/special/_basic.py:2352: TypeError
-------------------------------------- Captured log call --------------------------------------
DEBUG    domain:domain.py:55 Global coeff shape: [128]
DEBUG    distributor:distributor.py:92 Mesh: []
DEBUG    problems:problems.py:127 Parsing Eqn 0
DEBUG    problems:problems.py:146   Condition: True
DEBUG    problems:problems.py:147   LHS string form: dx(u) + 2*x*u
DEBUG    problems:problems.py:148   RHS string form: 0
DEBUG    problems:problems.py:155   LHS object form: dx(u) + ((2*x)*u)
DEBUG    problems:problems.py:156   RHS object form: 0
DEBUG    problems:problems.py:308   L linear form: dx(u) + ((2*x)*u)
DEBUG    problems:problems.py:127 Parsing Eqn 1
DEBUG    problems:problems.py:146   Condition: True
DEBUG    problems:problems.py:147   LHS string form: integ(u)
DEBUG    problems:problems.py:148   RHS string form: sqrt(pi)
DEBUG    problems:problems.py:155   LHS object form: integ_x(u)
DEBUG    problems:problems.py:156   RHS object form: sqrt(pi)
DEBUG    problems:problems.py:308   L linear form: integ_x(u)
DEBUG    solvers:solvers.py:180 Beginning LBVP instantiation
DEBUG    basis:basis.py:1064 Building Hermite MMT matrices for (gsize, csize, env) = (128, 128, False)
_________________________ test_qho_dense_evp[Hermite-128-complex128] __________________________

benchmark = None, x_basis_class = <class 'dedalus.core.basis.Hermite'>, Nx = 128
dtype = <class 'numpy.complex128'>

    @pytest.mark.parametrize('dtype', [np.complex128])
    @pytest.mark.parametrize('Nx', [128])
    @pytest.mark.parametrize('x_basis_class', [de.Hermite])
    @bench_wrapper
    def test_qho_dense_evp(benchmark, x_basis_class, Nx, dtype):
        n_comp = 10
        # Stretch Laguerres
        if x_basis_class is de.Hermite:
            stretch = 1.0
        else:
            stretch = 0.4
        # Domain
        x_basis = x_basis_class('x', Nx, center=0, stretch=stretch)
        domain = de.Domain([x_basis], np.float64)
        # Problem
        problem = de.EVP(domain, variables=['ψ', 'ψx'], eigenvalue='E')
        problem.substitutions["V"] = "x**2 / 2"
        problem.substitutions["H(ψ,ψx)"] = "-dx(ψx)/2 + V*ψ"
        problem.add_equation("ψx - dx(ψ) = 0", tau=False)
        problem.add_equation("H(ψ,ψx) - E*ψ = 0", tau=False)
        # Solver
        solver = problem.build_solver()
>       solver.solve_dense(solver.pencils[0])

opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_evp.py:128:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/solvers.py:95: in solve_dense
    pencil.build_matrices(self.problem, ['M', 'L'], cacheid=cacheid)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/pencil.py:259: in _build_coupled_matrices
    Ei = eq_expr.operator_dict(global_index, eq_vars, cacheid=cacheid, **problem.ncc_kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/operators.py:440: in operator_dict
    op1 = self.args[1].operator_dict(index, vars, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/operators.py:719: in operator_dict
    op0 = self.args[0].as_ncc_operator(frozen_arg1_basis_meta, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/future.py:208: in as_ncc_operator
    return ncc.as_ncc_operator(frozen_arg_basis_meta, cutoff, max_terms, cacheid=None)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:289: in as_ncc_operator
    return ncc.as_ncc_operator(frozen_arg_basis_meta, cutoff, max_terms, cacheid=None)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:556: in as_ncc_operator
    self.require_coeff_space()
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:440: in require_coeff_space
    self.towards_coeff_space()
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/field.py:423: in towards_coeff_space
    self.domain.dist.paths[index-1].decrement([self])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/distributor.py:372: in decrement
    self.decrement_single(*fields)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/distributor.py:357: in decrement_single
    self.basis.forward(gdata, cdata, self.axis, field.meta[self.axis], field.scales[self.axis])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/basis.py:1090: in _forward_mmt
    forward_mat, _ = self._mmt_setup(gdata.shape[axis], cdata.shape[axis], meta['envelope'])
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tools/cache.py:71: in __call__
    self.cache[call] = result = self.function(*args, **kw)
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/basis.py:1081: in _mmt_setup
    N2 = np.sqrt(np.pi) * 2**n * special.factorial(n, exact=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

n = array([[  0.],
       [  1.],
       [  2.],
       [  3.],
       [  4.],
       [  5.],
       [  6.],
       [  7.]...     [121.],
       [122.],
       [123.],
       [124.],
       [125.],
       [126.],
       [127.]], dtype=float128)
exact = True

    def factorial(n, exact=False):
        """
        The factorial of a number or array of numbers.

        The factorial of non-negative integer `n` is the product of all
        positive integers less than or equal to `n`::

            n! = n * (n - 1) * (n - 2) * ... * 1

        Parameters
        ----------
        n : int or array_like of ints
            Input values.  If ``n < 0``, the return value is 0.
        exact : bool, optional
            If True, calculate the answer exactly using long integer arithmetic.
            If False, result is approximated in floating point rapidly using the
            `gamma` function.
            Default is False.

        Returns
        -------
        nf : float or int or ndarray
            Factorial of `n`, as integer or float depending on `exact`.

        Notes
        -----
        For arrays with ``exact=True``, the factorial is computed only once, for
        the largest input, with each other result computed in the process.
        The output dtype is increased to ``int64`` or ``object`` if necessary.

        With ``exact=False`` the factorial is approximated using the gamma
        function:

        .. math:: n! = \\Gamma(n+1)

        Examples
        --------
        >>> from scipy.special import factorial
        >>> arr = np.array([3, 4, 5])
        >>> factorial(arr, exact=False)
        array([   6.,   24.,  120.])
        >>> factorial(arr, exact=True)
        array([  6,  24, 120])
        >>> factorial(5, exact=True)
        120

        """
        if exact:
            if np.ndim(n) == 0:
                if np.isnan(n):
                    return n
                return 0 if n < 0 else math.factorial(n)
            else:
                n = asarray(n)
                un = np.unique(n).astype(object)

                # Convert to object array of long ints if np.int_ can't handle size
                if np.isnan(n).any():
                    dt = float
                elif un[-1] > 20:
                    dt = object
                elif un[-1] > 12:
                    dt = np.int64
                else:
                    dt = np.int_

                out = np.empty_like(n, dtype=dt)

                # Handle invalid/trivial values
                # Ignore runtime warning when less operator used w/np.nan
                with np.errstate(all='ignore'):
                    un = un[un > 1]
                    out[n < 2] = 1
                    out[n < 0] = 0

                # Calculate products of each range of numbers
                if un.size:
>                   val = math.factorial(un[0])
E                   TypeError: 'numpy.float128' object cannot be interpreted as an integer

opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/scipy/special/_basic.py:2352: TypeError
------------------------------------ Captured stdout call -------------------------------------
2021-03-17 11:08:24,391 problems 0/1 INFO :: Solving EVP with homogeneity tolerance of 1.000e-10
-------------------------------------- Captured log call --------------------------------------
DEBUG    domain:domain.py:55 Global coeff shape: [128]
DEBUG    distributor:distributor.py:92 Mesh: []
INFO     problems:problems.py:523 Solving EVP with homogeneity tolerance of 1.000e-10
DEBUG    problems:problems.py:127 Parsing Eqn 0
DEBUG    problems:problems.py:146   Condition: True
DEBUG    problems:problems.py:147   LHS string form: ψx - dx(ψ)
DEBUG    problems:problems.py:148   RHS string form: 0
DEBUG    problems:problems.py:155   LHS object form: ψx + (-1*dx(ψ))
DEBUG    problems:problems.py:156   RHS object form: 0
DEBUG    problems:problems.py:308   M linear form: 0
DEBUG    problems:problems.py:308   L linear form: ψx + (-1*dx(ψ))
DEBUG    problems:problems.py:127 Parsing Eqn 1
DEBUG    problems:problems.py:146   Condition: True
DEBUG    problems:problems.py:147   LHS string form: H(ψ,ψx) - E*ψ
DEBUG    problems:problems.py:148   RHS string form: 0
DEBUG    problems:problems.py:155   LHS object form: (((-1*dx(ψx))*0.5) + (((x**2)*0.5)*ψ)) + (-1*(E*ψ))
DEBUG    problems:problems.py:156   RHS object form: 0
DEBUG    problems:problems.py:308   M linear form: -1*ψ
DEBUG    problems:problems.py:308   L linear form: (-0.5*dx(ψx)) + (((x**2)*0.5)*ψ)
DEBUG    solvers:solvers.py:58 Beginning EVP instantiation
DEBUG    solvers:solvers.py:73 Finished EVP instantiation
DEBUG    basis:basis.py:1064 Building Hermite MMT matrices for (gsize, csize, env) = (128, 128, False)
====================================== warnings summary =======================================
opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_output.py::test_1d_output[Chebyshev-32-RK222-float64]
  /Users/ketch/opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/evaluator.py:496: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    ('iteration', np.int),

opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_output.py::test_1d_output[Chebyshev-32-RK222-float64]
  /Users/ketch/opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/core/evaluator.py:497: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, use `int` by itself. Doing this will not modify any behavior and is safe. When replacing `np.int`, you may wish to use e.g. `np.int64` or `np.int32` to specify the precision. If you wish to review your current use, check the release note link for additional information.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    ('write_number', np.int)]:

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=================================== short test summary info ===================================
FAILED opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_bvp.py::test_gaussian_free[Hermite-128-float64]
FAILED opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_bvp.py::test_gaussian_free[Hermite-128-complex128]
FAILED opt/miniconda3/envs/dedalus/lib/python3.8/site-packages/dedalus/tests/test_evp.py::test_qho_dense_evp[Hermite-128-complex128]
============== 3 failed, 172 passed, 24 skipped, 2 xfailed, 2 warnings in 10.73s ==============
afraser3 commented 3 years ago

Generally for issues with installation I recommend posting to the google group, where more users are likely to see your post and chime in if they've faced a similar issue (also, you might find by searching around there that someone else has posted about a similar issue).

If you aren't planning on using Hermite bases, then it looks like this installation will work fine for you. If you do need Hermite bases, I recommend pulling the latest version, which the conda install script might not have installed for you. It looks like a recent commit may have addressed these errors you're seeing.

kburns commented 3 years ago

Yeah this was due to some platform/scipy-version-specific issues with factorials and only affects Hermite/Laguerre bases. It's been fixed on master and will be included in the next release.

kburns commented 3 years ago

Duplicate of #110.

ketch commented 3 years ago

Thanks!