Skip to content

Commit

Permalink
Consistency fix for grid methods with no grid
Browse files Browse the repository at this point in the history
    subsitute_cell_names
    column_indices

generic fallbacks include no grid case (grid == nothing)
  • Loading branch information
sjdaines committed Jan 5, 2025
1 parent fb92d7b commit 00c96d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/CoordsDims.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ PALEO convention is that where possible `coordinates` contains:
function set_coordinates! end

"""
function get_coordinates(obj, dimname) -> coordinates::Vector{String}
function get_coordinates(obj, dimname) -> coordinates::Vector
Get coordinates (if any) attached to `dimname` for PALEO object `obj`
Expand Down
6 changes: 3 additions & 3 deletions src/Grids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,12 @@ function _show_subdomains_dimensions_coordinates(io, grid::PB.AbstractMesh)
end

# generic fallback for named cells
substitute_cell_names(grid::PB.AbstractMesh, cells) = cells
substitute_cell_names(grid::PB.AbstractMesh, cells::Union{Number, Symbol}) =
substitute_cell_names(grid::PB.AbstractMeshOrNothing, cells) = cells
substitute_cell_names(grid::PB.AbstractMeshOrNothing, cells::Union{Number, Symbol}) =
substitute_cell_names(grid, [cells])[]

# generic fallback for column indices
function column_indices(grid::PB.AbstractMesh, column)
function column_indices(grid::PB.AbstractMeshOrNothing, column)
throw(ArgumentError("grid $grid does not support column selection"))
end

Expand Down

0 comments on commit 00c96d6

Please sign in to comment.