Skip to content

Commit

Permalink
Fix type instability (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
luraess authored Mar 12, 2024
2 parents 1f04329 + 54a2166 commit 6b0c20c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Chmy"
uuid = "33a72cf0-4690-46d7-b987-06506c2248b9"
authors = ["Ivan Utkin <[email protected]>, Ludovic Raess <[email protected]>, and contributors"]
version = "0.1.1"
version = "0.1.2"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
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 6b0c20c

Please sign in to comment.