Skip to content

Commit

Permalink
fix another import error
Browse files Browse the repository at this point in the history
  • Loading branch information
Yolan Uyttenhove committed Feb 23, 2024
1 parent 692d55b commit c3ddc86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions swiftsimio/visualisation/slice_backends/nearest_neighbors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from numpy import float64, float32, ndarray, linspace, array, stack, meshgrid
from numpy import float64, float32, ndarray, linspace, array, stack, meshgrid, power

from swiftsimio import SWIFTDataset, cosmo_array
from swiftsimio.optional_packages import KDTree, TREE_AVAILABLE
Expand Down Expand Up @@ -117,13 +117,13 @@ def get_hsml(data: SWIFTDataset) -> cosmo_array:
The extracted "smoothing lengths".
"""
try:
hsml = np.power(data.gas.volume, 1.0 / 3.0)
hsml = power(data.gas.volume, 1.0 / 3.0)
except AttributeError:
try:
# Try computing the volumes explicitly?
masses = data.gas.masses
densities = data.gas.densities
hsml = np.power(masses / densities, 1.0 / 3.0)
hsml = power(masses / densities, 1.0 / 3.0)
except AttributeError:
# Fall back to SPH behavior if above didn't work...
hsml = sph_get_hsml(data)
Expand Down

0 comments on commit c3ddc86

Please sign in to comment.