Skip to content

Commit

Permalink
Merge pull request #141 from MJKirk/conditional-scipy-import
Browse files Browse the repository at this point in the history
Only import scipy when used
  • Loading branch information
JohannesBuchner authored Jul 2, 2024
2 parents bceff1a + aae8967 commit be59148
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ultranest/hotstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"""

import numpy as np
import scipy.stats

from .utils import resample_equal, vectorize

Expand Down Expand Up @@ -67,6 +66,7 @@ def get_auxiliary_problem(loglike, transform, ctr, invcov, enlargement_factor, d
The first d return coordinates are identical to what ``transform`` would return.
The final coordinate is the correction weight.
"""
import scipy.stats
ndim, = ctr.shape
assert invcov.shape == (ndim, ndim)
assert df >= 1, ('Degrees of freedom must be above 1', df)
Expand Down Expand Up @@ -143,6 +143,7 @@ def get_extended_auxiliary_problem(loglike, transform, ctr, invcov, enlargement_
The first d return coordinates are identical to what ``transform`` would return.
The final coordinate is the correction weight.
"""
import scipy.stats
ndim, = ctr.shape
assert invcov.shape == (ndim, ndim)
assert df >= 1, ('Degrees of freedom must be above 1', df)
Expand Down Expand Up @@ -224,6 +225,7 @@ def get_extended_auxiliary_independent_problem(loglike, transform, ctr, err, df=
The first d return coordinates are identical to what ``transform`` would return.
The final coordinate is the log of the correction weight.
"""
import scipy.stats
ndim, = np.shape(ctr)
assert np.shape(err) == (ndim,)
assert df >= 1, ('Degrees of freedom must be above 1', df)
Expand Down

0 comments on commit be59148

Please sign in to comment.