Skip to content

Commit

Permalink
test netcdf source propagation for urls
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Jun 3, 2023
1 parent 5d47171 commit 5eb4696
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ext/RastersNCDatasetsExt/ncdatasets_source.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function RA.Raster(ds::NCD.NCDataset, filename::AbstractString, key=nothing; kw.
end
throw(ArgumentError("dataset at $filename has no array variables"))
else
return Raster(ds[key], filename, key; kw...)
return Raster(ds[key], filename, key; source=NCDsource, kw...)
end
end

Expand Down
6 changes: 6 additions & 0 deletions test/sources/ncdatasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ end
@test parent(eagerarray) isa Array
end

@testset "from url" begin
url = "http:https://apdrc.soest.hawaii.edu:80/dods/public_data/Reanalysis_Data/NCEP/NCEP2/daily/surface/mslp"
r = Raster(url; name=:mslp, source=:netcdf, lazy=true)
@test sum(r[Ti(1)]) == 1.0615972f9
end

@testset "open" begin
@test all(open(A -> A[Y=1], ncarray) .=== ncarray[:, 1, :])
end
Expand Down

0 comments on commit 5eb4696

Please sign in to comment.