Skip to content

Commit

Permalink
avoid potential circular ref by lazy import
Browse files Browse the repository at this point in the history
akrherz committed Oct 18, 2019
1 parent 8c1ca0a commit 5ea3cd0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/metpy/calc/tools.py
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@ def normalize_axis_index(a, n):
from scipy.spatial import cKDTree
import xarray as xr

from . import height_to_pressure_std, pressure_to_height_std
from ..cbook import broadcast_indices, result_type
from ..deprecation import deprecated, metpyDeprecation
from ..interpolate.one_dimension import interpolate_1d, interpolate_nans_1d, log_interpolate_1d
@@ -356,6 +355,8 @@ def _get_bound_pressure_height(pressure, bound, heights=None, interpolate=True):
The bound pressure and height.
"""
# avoid circular import if basic.py ever imports something from tools.py
from .basic import height_to_pressure_std, pressure_to_height_std
# Make sure pressure is monotonically decreasing
sort_inds = np.argsort(pressure)[::-1]
pressure = pressure[sort_inds]

0 comments on commit 5ea3cd0

Please sign in to comment.