Skip to content

Commit

Permalink
Fixup type instability
Browse files Browse the repository at this point in the history
  • Loading branch information
luraess committed Mar 12, 2024
1 parent 1f04329 commit b84cb65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Grids/structured_grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ end
Return a tuple of grid spacing for a uniform grid `grid`.
"""
spacing(grid::UniformGrid) = getfield.(grid.axes, :spacing)
spacing(grid::UniformGrid{N}) where {N} = ntuple(D -> grid.axes[D].spacing, Val(N))
spacing(grid::UniformGrid, ::Dim{dim}) where {dim} = grid.axes[dim].spacing

"""
inv_spacing(grid::UniformGrid)
Return a tuple of inverse grid spacing for a uniform grid `grid`.
"""
inv_spacing(grid::UniformGrid) = getfield.(grid.axes, :inv_spacing)
inv_spacing(grid::UniformGrid{N}) where {N} = ntuple(D -> grid.axes[D].inv_spacing, Val(N))
inv_spacing(grid::UniformGrid, ::Dim{dim}) where {dim} = grid.axes[dim].inv_spacing

# coordinate lists
Expand Down

0 comments on commit b84cb65

Please sign in to comment.