Skip to content

Commit

Permalink
fix downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Dec 18, 2020
1 parent 9c6d6e4 commit cbb62d5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1.4'
version: '1.5'
- run: |
julia --project=docs -e '
using Pkg
Expand Down
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ URIs = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
HTTP = "0.8, 0.9"
ZipFile = "0.9"
URIs = "1"
julia = "^1.5"
4 changes: 2 additions & 2 deletions src/awap/awap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ function getraster(T::Type{AWAP}, layer::Symbol; date)
for d in dates
raster_path = rasterpath(T, layer; date=d)
if !isfile(raster_path)
zip_path = zippath(T, layer, d)
_maybe_download(zipurl(T, layer, d), zip_path)
zip_path = zippath(T, layer; date=d)
_maybe_download(zipurl(T, layer; date=d), zip_path)
run(`uncompress $zip_path -f`)
end
push!(raster_paths, raster_path)
Expand Down
5 changes: 3 additions & 2 deletions src/chelsa/bioclim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ rasterpath(::Type{CHELSA}) = joinpath(rasterpath(), "CHELSA")
rasterpath(::Type{CHELSA{BioClim}}) = joinpath(rasterpath(CHELSA), "BioClim")
rasterpath(T::Type{CHELSA{BioClim}}, layer::Integer) = joinpath(rasterpath(T), rastername(T, layer))

rasterurl(::Type{CHELSA}) = URI(scheme="ftp", host="envidatrepo.wsl.ch", path="/uploads/chelsa/")
rasterurl(::Type{CHELSA{BioClim}}) = joinpath(rasterurl(CHELSA), "chelsa_V1/climatologies/bio/")
# https://os.zhdk.cloud.switch.ch/envicloud/chelsa/chelsa_V1/climatologies/bio/CHELSA_prec_01_V1.2_land.tif
rasterurl(::Type{CHELSA}) = URI(scheme="https", host="os.zhdk.cloud.switch.ch", path="/envicloud/chelsa/chelsa_V1/")
rasterurl(::Type{CHELSA{BioClim}}) = joinpath(rasterurl(CHELSA), "climatologies/bio/")
rasterurl(T::Type{CHELSA{BioClim}}, layer::Integer) = joinpath(rasterurl(T), rastername(T, layer))
4 changes: 2 additions & 2 deletions test/alwb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
date = DateTime(2018, 01, 01), DateTime(2018, 03, 02)
getraster(ALWB{Values,Day}, :ss_pct; date)
@test isfile(joinpath(alwb_path, "values", "day", "ss_pct_2018.nc"))
getraster(ALWB{Deciles,Month}, :ss_pct; date)
getraster(ALWB{Deciles,Month}, :s0_pct; date)
@test isfile(joinpath(alwb_path, "deciles", "month", "s0_pct.nc"))

getraster(ALWB{Values,Day}, :ma_wet; date)
@test isfile(joinpath(alwb_path, "values", "day", "ma_wet_2018.nc"))
getraster(ALWB{Values,Month}, :ma_wet; date)
getraster(ALWB{Values,Month}, :etot; date)
@test isfile(joinpath(alwb_path, "values", "month", "etot.nc"))
getraster(ALWB{Values,Year}, :asce_pet; date)
@test isfile(joinpath(alwb_path, "values", "year", "asce_pet.nc"))
Expand Down
4 changes: 2 additions & 2 deletions test/chelsa-bioclim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
@test rasterpath(CHELSA{BioClim}, 5) == joinpath(bioclim_path, "CHELSA_bio10_05.tif")

@test rasterurl(CHELSA) ==
URI(scheme="ftp", host="envidatrepo.wsl.ch", path="/uploads/chelsa/")
URI(scheme="https", host="os.zhdk.cloud.switch.ch", path="/envicloud/chelsa/chelsa_V1/")
@test rasterurl(CHELSA{BioClim}, 5) ==
URI(scheme="ftp", host="envidatrepo.wsl.ch", path="/uploads/chelsa/chelsa_V1/climatologies/bio/CHELSA_bio10_05.tif")
URI(scheme="https", host="os.zhdk.cloud.switch.ch", path="/envicloud/chelsa/chelsa_V1/climatologies/bio/CHELSA_bio10_05.tif")

getraster(CHELSA{BioClim}, 5)
@test isfile(joinpath(bioclim_path, "CHELSA_bio10_05.tif"))
Expand Down

2 comments on commit cbb62d5

@rafaqz
Copy link
Member Author

@rafaqz rafaqz commented on cbb62d5 Dec 18, 2020

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/26594

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" cbb62d58b87e36ce7851f8dd2c02e775049da001
git push origin v0.1.0

Please sign in to comment.