Skip to content

Commit

Permalink
more test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Oct 12, 2024
1 parent bcd7fb1 commit f5fce8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/cellarea.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ include(joinpath(dirname(pathof(Rasters)), "../test/test_utils.jl"))
# This is the simplest case
unitful_manifold = Spherical(; radius = Spherical().radius * Unitful.u"m")
unitful_cellarea = cellarea(unitful_manifold, dimz_3857)
@test unitful_cellarea isa Raster{<:Quantity}
@test unitful_cellarea isa Raster{<:Unitful.Quantity}
@test Unitful.ustrip.(parent(unitful_cellarea)) == cellarea(Spherical(; radius = unitful_manifold.radius |> Unitful.ustrip), dimz_3857)
# Case 2: unitful dimensions
ux_3857 = rebuild(x_3857; val = rebuild(val(x_3857); data = val(x_3857) .* Unitful.u"m", span = Regular(val(x_3857).span.step * Unitful.u"m")))
uy_3857 = rebuild(y_3857; val = rebuild(val(y_3857); data = val(y_3857) .* Unitful.u"m", span = Regular(val(y_3857).span.step * Unitful.u"m")))
unitful_dimz_3857 = (ux_3857, uy_3857)
@test cellarea(Planar(), unitful_dimz_3857) isa Raster{<:Quantity}
@test cellarea(Planar(), unitful_dimz_3857) isa Raster{<:Unitful.Quantity}
@test Unitful.ustrip.(parent(cellarea(Planar(), unitful_dimz_3857))) == parent(cellarea(Planar(), dimz_3857))
# Unitful lookups shouldn't work without a unitful manifold
@test_throws Unitful.DimensionError cellarea(unitful_dimz_3857)
Expand All @@ -93,7 +93,7 @@ include(joinpath(dirname(pathof(Rasters)), "../test/test_utils.jl"))
# doesn't do.

# unitful_cellarea = cellarea(unitful_manifold, unitful_dimz_3857)
# @test unitful_cellarea isa Raster{<:Quantity}
# @test unitful_cellarea isa Raster{<:Unitful.Quantity}
# @test Unitful.ustrip.(unitful_cellarea) == cellarea(unitful_manifold, dimz_3857)
end
end

0 comments on commit f5fce8b

Please sign in to comment.