Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Mar 30, 2023
1 parent 6d180a6 commit 648b12d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/deltares/worldflood.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ function _validate_deltares_worldflood_params(; year, res, dem_source, return_pe
# check the parameters
# resolution depends on dem_source
if dem_source == :NASADEM || dem_source == :MERITDEM
@assert res in ("90m", "1km")
@assert res in ("90m", "1km") "Provided: $res, expected one of "
elseif dem_source == :LIDAR
@assert res == "5km"
@assert res == "5km" "Provided: $res, expected one of "

Check warning on line 11 in src/deltares/worldflood.jl

View check run for this annotation

Codecov / codecov/patch

src/deltares/worldflood.jl#L8-L11

Added lines #L8 - L11 were not covered by tests
else
@assert dem_source in (:NASADEM, :MERITDEM, :LIDAR)
@assert dem_source in (:NASADEM, :MERITDEM, :LIDAR) "Provided: $dem_source, expected one of "

Check warning on line 13 in src/deltares/worldflood.jl

View check run for this annotation

Codecov / codecov/patch

src/deltares/worldflood.jl#L13

Added line #L13 was not covered by tests
end

@assert return_period in (0, 2, 5, 10, 25, 50, 100, 250)
@assert year in (2018, 2050)
@assert return_period in (0, 2, 5, 10, 25, 50, 100, 250) "Provided: $return_period, expected one of "
@assert year in (2018, 2050) "Provided: $year, expected one of "
return true

Check warning on line 18 in src/deltares/worldflood.jl

View check run for this annotation

Codecov / codecov/patch

src/deltares/worldflood.jl#L16-L18

Added lines #L16 - L18 were not covered by tests
end


getraster_keywords(::Type{<: Deltares{<: WorldFlood}}) = (:year, :res, :dem_source, :return_period)

Check warning on line 22 in src/deltares/worldflood.jl

View check run for this annotation

Codecov / codecov/patch

src/deltares/worldflood.jl#L22

Added line #L22 was not covered by tests

function rastername(::Type{<: Deltares{<: WorldFlood}}, layer; res::String =" 90m", dem_source::Symbol = :NASADEM, return_period::Int = 100)
function rastername(::Type{<: Deltares{<: WorldFlood}}, layer; year = 2050, res::String = "90m", dem_source::Symbol = :NASADEM, return_period::Int = 100)

Check warning on line 24 in src/deltares/worldflood.jl

View check run for this annotation

Codecov / codecov/patch

src/deltares/worldflood.jl#L24

Added line #L24 was not covered by tests

# validate params
_validate_deltares_worldflood_params(; year, res, dem_source, return_period)
"GFM_global_$(dem_source)$(res)_$(sea_level_year)slr_rp$(lpad(return_period, 4, '0'))_masked.nc"
"GFM_global_$(dem_source)$(res)_$(year)slr_rp$(lpad(return_period, 4, '0'))_masked.nc"

Check warning on line 28 in src/deltares/worldflood.jl

View check run for this annotation

Codecov / codecov/patch

src/deltares/worldflood.jl#L27-L28

Added lines #L27 - L28 were not covered by tests

end

function rasterpath(T::Type{<: Deltares{<: WorldFlood}}, layer; year = 2050, res::String =" 90m", dem_source::Symbol = :NASADEM, return_period::Int = 100)
function rasterpath(T::Type{<: Deltares{<: WorldFlood}}, layer; year = 2050, res::String = "90m", dem_source::Symbol = :NASADEM, return_period::Int = 100)

Check warning on line 32 in src/deltares/worldflood.jl

View check run for this annotation

Codecov / codecov/patch

src/deltares/worldflood.jl#L32

Added line #L32 was not covered by tests

# validate params
_validate_deltares_worldflood_params(; year, res, dem_source, return_period)
Expand All @@ -48,7 +48,7 @@ function rasterurl(T::Type{<: Deltares{<: WorldFlood}}, layer; year = 2050, res:

end

function getraster(T::Type{<: Deltares{<: WorldFlood}}, layer; year = 2050, res::String =" 90m", dem_source::Symbol = :NASADEM, return_period::Int = 100)
function getraster(T::Type{<: Deltares{<: WorldFlood}}, layer; year = 2050, res::String = "90m", dem_source::Symbol = :NASADEM, return_period::Int = 100)
raster_path = rasterpath(T, layer; year, res, dem_source, return_period)
mkpath(dirname(raster_path))
_maybe_download(rasterurl(T, layer; year, res, dem_source, return_period), raster_path)
Expand Down

0 comments on commit 648b12d

Please sign in to comment.