Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #98 from EcoJulia/gd/show
Browse files Browse the repository at this point in the history
Add indentation in show method
  • Loading branch information
gabrieldansereau authored May 14, 2021
2 parents ba22fed + 268c807 commit c7a9d2e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/lib/overloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ import Base: vcat
import Base: show

"""
Base.show(io::IO, ::MIME"text/plain", layer::T) where {T <: SimpleSDMLayer}
Base.show(io::IO, layer::T) where {T <: SimpleSDMLayer}
Shows a textual representation of the layer.
"""
function Base.show(io::IO, layer::T) where {T <: SimpleSDMLayer}
function Base.show(io::IO, ::MIME"text/plain", layer::T) where {T <: SimpleSDMLayer}
itype = eltype(layer)
otype = T <: SimpleSDMPredictor ? "predictor" : "response"
print(io, """SDM $(otype)$(size(layer,1))×$(size(layer,2)) grid with $(length(layer)) $(itype)-valued cells
Latitudes\t$(extrema(latitudes(layer)))
Longitudes\t$(extrema(longitudes(layer)))""")
\x20\x20Latitudes\t$(extrema(latitudes(layer)))
\x20\x20Longitudes\t$(extrema(longitudes(layer)))""")
end

function Base.show(io::IO, layer::T) where {T <: SimpleSDMLayer}
itype = eltype(layer)
otype = T <: SimpleSDMPredictor ? "predictor" : "response"
print(io, "SDM $(otype)$(size(layer,1))×$(size(layer,2)) grid with $(length(layer)) $(itype)-valued cells")
end

"""
Expand Down

2 comments on commit c7a9d2e

@tpoisot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to tag a new patch release?

@gabrieldansereau
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed, I'll tag a minor release instead since I removed the compatibility with older versions of ArchGDAL in #97.

Please sign in to comment.