Skip to content

Commit

Permalink
remove ArtifactWrappers from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kmdeck committed Jun 4, 2024
1 parent e6674b0 commit 0db0092
Show file tree
Hide file tree
Showing 12 changed files with 169 additions and 121 deletions.
45 changes: 23 additions & 22 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.3"
manifest_format = "2.0"
project_hash = "4bb6840a53a8b41815eea340f539147bec0b0ca9"
project_hash = "bf43a7452b446a9ba967dab8eeb0bc21ba10184f"

[[deps.ADTypes]]
git-tree-sha1 = "daf26bbdec60d9ca1c0003b70f389d821ddb4224"
Expand Down Expand Up @@ -271,38 +271,39 @@ version = "0.10.14"

[[deps.CUDA]]
deps = ["AbstractFFTs", "Adapt", "BFloat16s", "CEnum", "CUDA_Driver_jll", "CUDA_Runtime_Discovery", "CUDA_Runtime_jll", "Crayons", "DataFrames", "ExprTools", "GPUArrays", "GPUCompiler", "KernelAbstractions", "LLVM", "LLVMLoopInfo", "LazyArtifacts", "Libdl", "LinearAlgebra", "Logging", "NVTX", "Preferences", "PrettyTables", "Printf", "Random", "Random123", "RandomNumbers", "Reexport", "Requires", "SparseArrays", "StaticArrays", "Statistics"]
git-tree-sha1 = "baa8ea7a1ea63316fa3feb454635215773c9c845"
git-tree-sha1 = "6e945e876652f2003e6ca74e19a3c45017d3e9f6"
uuid = "052768ef-5323-5732-b1bb-66c8b64840ba"
version = "5.2.0"
weakdeps = ["ChainRulesCore", "SpecialFunctions"]
version = "5.4.2"
weakdeps = ["ChainRulesCore", "EnzymeCore", "SpecialFunctions"]

[deps.CUDA.extensions]
ChainRulesCoreExt = "ChainRulesCore"
EnzymeCoreExt = "EnzymeCore"
SpecialFunctionsExt = "SpecialFunctions"

[[deps.CUDA_Driver_jll]]
deps = ["Artifacts", "JLLWrappers", "LazyArtifacts", "Libdl", "Pkg"]
git-tree-sha1 = "d01bfc999768f0a31ed36f5d22a76161fc63079c"
git-tree-sha1 = "c48f9da18efd43b6b7adb7ee1f93fe5f2926c339"
uuid = "4ee394cb-3365-5eb0-8335-949819d2adfc"
version = "0.7.0+1"
version = "0.9.0+0"

[[deps.CUDA_Runtime_Discovery]]
deps = ["Libdl"]
git-tree-sha1 = "38f830504358e9972d2a0c3e5d51cb865e0733df"
git-tree-sha1 = "5db9da5fdeaa708c22ba86b82c49528f402497f2"
uuid = "1af6417a-86b4-443c-805f-a4643ffb695f"
version = "0.2.4"
version = "0.3.3"

[[deps.CUDA_Runtime_jll]]
deps = ["Artifacts", "CUDA_Driver_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"]
git-tree-sha1 = "8e25c009d2bf16c2c31a70a6e9e8939f7325cc84"
git-tree-sha1 = "bcba305388e16aa5c879e896726db9e71b4942c6"
uuid = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"
version = "0.11.1+0"
version = "0.14.0+1"

[[deps.CUDNN_jll]]
deps = ["Artifacts", "CUDA_Runtime_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "TOML"]
git-tree-sha1 = "75923dce4275ead3799b238e10178a68c07dbd3b"
git-tree-sha1 = "cbf7d75f8c58b147bdf6acea2e5bc96cececa6d4"
uuid = "62b44479-cb7b-5706-934f-f13b2eb2e645"
version = "8.9.4+0"
version = "9.0.0+1"

[[deps.Cairo]]
deps = ["Cairo_jll", "Colors", "Glib_jll", "Graphics", "Libdl", "Pango_jll"]
Expand Down Expand Up @@ -823,9 +824,9 @@ version = "0.1.1"

[[deps.FastBroadcast]]
deps = ["ArrayInterface", "LinearAlgebra", "Polyester", "Static", "StaticArrayInterface", "StrideArraysCore"]
git-tree-sha1 = "a6e756a880fc419c8b41592010aebe6a5ce09136"
git-tree-sha1 = "699c2556ecdf3b5913c7a57769f8975adf48cf8e"
uuid = "7034ab61-46d4-4ed7-9d0f-46aef9175898"
version = "0.2.8"
version = "0.3.0"

[[deps.FastClosures]]
git-tree-sha1 = "acebe244d53ee1b461970f8910c235b259e772ef"
Expand Down Expand Up @@ -1008,9 +1009,9 @@ version = "0.1.6"

[[deps.GPUCompiler]]
deps = ["ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "Scratch", "TimerOutputs", "UUIDs"]
git-tree-sha1 = "a846f297ce9d09ccba02ead0cae70690e072a119"
git-tree-sha1 = "518ebd058c9895de468a8c255797b0c53fdb44dd"
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
version = "0.25.0"
version = "0.26.5"

[[deps.GR]]
deps = ["Artifacts", "Base64", "DelimitedFiles", "Downloads", "GR_jll", "HTTP", "JSON", "Libdl", "LinearAlgebra", "Preferences", "Printf", "Random", "Serialization", "Sockets", "TOML", "Tar", "Test", "p7zip_jll"]
Expand Down Expand Up @@ -1383,9 +1384,9 @@ version = "3.0.0+1"

[[deps.LLVM]]
deps = ["CEnum", "LLVMExtra_jll", "Libdl", "Preferences", "Printf", "Requires", "Unicode"]
git-tree-sha1 = "839c82932db86740ae729779e610f07a1640be9a"
git-tree-sha1 = "065c36f95709dd4a676dc6839a35d6fa6f192f24"
uuid = "929cbde3-209d-540e-8aea-75f648917ca0"
version = "6.6.3"
version = "7.1.0"
weakdeps = ["BFloat16s"]

[deps.LLVM.extensions]
Expand Down Expand Up @@ -2176,9 +2177,9 @@ version = "0.6.12"

[[deps.RecursiveArrayTools]]
deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "SparseArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"]
git-tree-sha1 = "758bc86b90e9fee2edc4af2a750b0d3f2d5c02c5"
git-tree-sha1 = "d0f8d22294f932efb1617d669aff73a5c97d38ff"
uuid = "731186ca-8d62-57ce-b412-fbd966d074cd"
version = "3.19.0"
version = "3.20.0"

[deps.RecursiveArrayTools.extensions]
RecursiveArrayToolsFastBroadcastExt = "FastBroadcast"
Expand Down Expand Up @@ -2938,9 +2939,9 @@ version = "0.2.5"

[[deps.cuDNN]]
deps = ["CEnum", "CUDA", "CUDA_Runtime_Discovery", "CUDNN_jll"]
git-tree-sha1 = "d433ec29756895512190cac9c96666d879f07b92"
git-tree-sha1 = "4909e87d6d62c29a897d54d9001c63932e41cb0e"
uuid = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"
version = "1.3.0"
version = "1.3.2"

[[deps.eudev_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg", "gperf_jll"]
Expand Down
1 change: 0 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[deps]
ArtifactWrappers = "a14bc488-3040-4b00-9dc1-f6467924858a"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
ClimaCore = "d414da3d-4745-48bb-8d80-42e94e092884"
Expand Down
5 changes: 0 additions & 5 deletions docs/src/APIs/Bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,3 @@ ClimaLand.Bucket.surface_albedo
ClimaLand.Bucket.beta_factor
```

## Artifact Path Functions

```@docs
ClimaLand.Bucket.cesm2_albedo_dataset_path
```
15 changes: 3 additions & 12 deletions docs/tutorials/standalone/Soil/evaporation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import ClimaParams as CP
using SurfaceFluxes
using StaticArrays
using Dates
using ArtifactWrappers
using DelimitedFiles: readdlm

using ClimaLand
Expand Down Expand Up @@ -208,17 +207,9 @@ evap = [
)[1] for k in 1:length(sol.t)
]
savepath = joinpath(pkgdir(ClimaLand), "docs/tutorials/standalone/Soil/")
evap_dataset = ArtifactWrapper(
@__DIR__,
"lehmann2008_fig8_evaporation",
ArtifactFile[ArtifactFile(
url = "https://caltech.box.com/shared/static/cgppw3tx6zdz7h02yt28ri44g1j088ju.csv",
filename = "lehmann2008_fig8_evaporation.csv",
),],
)
evap_datapath = get_data_folder(evap_dataset)
ref_soln_E =
readdlm(joinpath(evap_datapath, "lehmann2008_fig8_evaporation.csv"), ',')
evaporation_data =
ClimaLand.Artifacts.lehmann_assouline_or2008_evaporation_data();
ref_soln_E = readdlm(evaporation_data, ',')
ref_soln_E_350mm = ref_soln_E[2:end, 1:2]
data_dates = ref_soln_E_350mm[:, 1]
data_e = ref_soln_E_350mm[:, 2];
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/standalone/Soil/evaporation_gilat_loess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import ClimaParams as CP
using SurfaceFluxes
using StaticArrays
using Dates
using ArtifactWrappers
using DelimitedFiles: readdlm

using ClimaLand
Expand Down
11 changes: 2 additions & 9 deletions docs/tutorials/standalone/Soil/freezing_front.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
# # Import necessary modules
import SciMLBase
import ClimaTimeSteppers as CTS
using ArtifactWrappers
using DelimitedFiles
using CairoMakie

Expand Down Expand Up @@ -219,14 +218,8 @@ sol = SciMLBase.solve(prob, ode_algo; dt = dt, saveat = 0:3600:tf);
# This data was obtained by us from the figures of Hansson et al. (2004), but was originally obtained
# by Mizoguchi (1990). No error bars were reported, and we haven't quantified the error in our
# estimation of the data from images.
af = ArtifactFile(
url = "https://caltech.box.com/shared/static/3xbo4rlam8u390vmucc498cao6wmqlnd.csv",
filename = "mizoguchi_all_data.csv",
)
dataset = ArtifactWrapper(@__DIR__, "mizoguchi", ArtifactFile[af]);
dataset_path = get_data_folder(dataset);
data = joinpath(dataset_path, "mizoguchi_all_data.csv")
ds = readdlm(data, ',')
dataset_path = ClimaLand.Artifacts.mizoguchi1990_soil_freezing_data();
ds = readdlm(dataset_path, ',')
hours = ds[:, 1][2:end]
vwc = ds[:, 2][2:end] ./ 100.0
depth = ds[:, 3][2:end]
Expand Down
13 changes: 3 additions & 10 deletions docs/tutorials/standalone/Soil/layered_soil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Can. J. Soil Sci. (2011) 91: 169183 doi:10.4141/CJSS09118,
# which measured the infiltration of layered soil in Fort McMurray,
# Alberta, Canada. We thank Mingbin Huang and S. Lee Barbour for
# correspondence and support, including sharing of data, with us
# correspondence and support, including sharing of data, with us.
# Note that all data used in this tutorial is available in their
# publication.

Expand All @@ -15,7 +15,6 @@ import SciMLBase
import ClimaTimeSteppers as CTS
using ClimaCore
import ClimaParams as CP
using ArtifactWrappers
using DelimitedFiles: readdlm

using ClimaLand
Expand All @@ -41,14 +40,8 @@ soil_domain = Column(; zlim = (zmin, zmax), nelements = nelems);
# Infiltration and drainage processes in multi-layered coarse soils
# Mingbin Huang et. al.
# Can. J. Soil Sci. (2011) 91: 169183 doi:10.4141/CJSS09118
af = ArtifactFile(
url = "https://caltech.box.com/shared/static/qvbt37xkwz8gveyi6tzzbs0e18trpcsq.csv",
filename = "sv_62.csv",
)
dataset = ArtifactWrapper(@__DIR__, "sv62", ArtifactFile[af]);
dataset_path = get_data_folder(dataset);
data = joinpath(dataset_path, af.filename)
parameter_data = readdlm(data, ',');
data_file = ClimaLand.Artifacts.huang_et_al2011_soil_van_genuchten_data();
parameter_data = readdlm(data_file, ',');
# Our model treats z as increasing in the upwards direction.
# Values below the surface are negative.
# Because of this, we convert the (positive-valued) depth
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/standalone/Soil/sublimation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ClimaParams as CP
using SurfaceFluxes
using StaticArrays
using Dates
using ArtifactWrappers
using DelimitedFiles: readdlm

using ClimaLand
Expand Down
131 changes: 131 additions & 0 deletions src/Artifacts.jl
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,137 @@ function topmodel_data_path(; context = nothing)
)
path = joinpath(get_data_folder(topmodel_dataset), "means_2.5_new.nc")
return path

end

"""
lehmann_assouline_or2008_evaporation_data(; context=nothing)
Local path to file containing measured evaporation rate as a function of time
for bare soil.
Data was originally collected by Lehmann, Peter, Shmuel Assouline,
and Dani Or. "Characteristic lengths affecting evaporative drying of
porous media." Physical Review E 77.5 (2008): 056309 and presented
in Figure 8 of that work.
https://doi.org/10.1103/PhysRevE.77.056309
"""
function lehmann_assouline_or2008_evaporation_data(; context = nothing)
dir = joinpath(@__DIR__, "../")
evap_dataset = ArtifactWrapper(
dir,
"lehmann2008_fig8_evaporation",
ArtifactFile[ArtifactFile(
url = "https://caltech.box.com/shared/static/cgppw3tx6zdz7h02yt28ri44g1j088ju.csv",
filename = "lehmann2008_fig8_evaporation.csv",
),],
)
evap_datapath = get_data_folder(evap_dataset)
return joinpath(evap_datapath, "lehmann2008_fig8_evaporation.csv")
end

"""
huang_et_al2011_soil_van_genuchten_data(; context=nothing)
Local path to file containing soil van Genuchten parameters as a
function of depth for soil
from site SV62 in Fort McMurray, Alberta, Canada.
Data was originally collected by Huang, Mingbin, et al.
"Infiltration and drainage processes in multi-layered coarse soils."
Canadian Journal of Soil Science 91.2 (2011): 169-183
and presented in Table 1b of that work.
https://doi.org/10.4141/cjss09118
"""
function huang_et_al2011_soil_van_genuchten_data(; context = nothing)
dir = joinpath(@__DIR__, "../")
af = ArtifactFile(
url = "https://caltech.box.com/shared/static/qvbt37xkwz8gveyi6tzzbs0e18trpcsq.csv",
filename = "sv_62.csv",
)
dataset = ArtifactWrapper(dir, "sv62", ArtifactFile[af])
dataset_path = get_data_folder(dataset)
return joinpath(dataset_path, af.filename)
end

"""
mizoguchi1990_soil_freezing_data(; context=nothing)
Local path to file containing soil volumetric content as a function
of depth and time during a freezing
soil column experiment.
Data was originally collected in Mizoguchi, M. 1990. Water, heat and
salt transport in freezing soil, Ph.D. thesis. (In Japanese.)
University of Tokyo, Tokyo.
Data was obtained by us from Figure 4 of Hansson, Klas, et al.
"Water flow and heat transport in frozen soil: Numerical solution
and freeze–thaw applications." Vadose Zone Journal 3.2 (2004): 693-704
using a plot digitizer; we did not quantify uncertainties introduced
in this process.
"""
function mizoguchi1990_soil_freezing_data(; context = nothing)
dir = joinpath(@__DIR__, "../")
af = ArtifactFile(
url = "https://caltech.box.com/shared/static/3xbo4rlam8u390vmucc498cao6wmqlnd.csv",
filename = "mizoguchi_all_data.csv",
)
dataset = ArtifactWrapper(dir, "mizoguchi", ArtifactFile[af])
dataset_path = joinpath(get_data_folder(dataset), "mizoguchi_all_data.csv")
return dataset_path
end

"""
cesm2_albedo_dataset_path()
Triggers the download of the CESM2 land albedo dataset, if not
already downloaded, using Julia Artifacts, and returns the path to
this file.
This dataset contains monthly albedo data from 15/01/1850
to 15/12/2014.
"""
function cesm2_albedo_dataset_path(; context = nothing)
dir = joinpath(@__DIR__, "../")
land_albedo_dataset = ArtifactWrapper(
dir,
"land_albedo",
ArtifactFile[ArtifactFile(
url = "https://caltech.box.com/shared/static/eesee8iv3c21z3pysizcgnuncfp5xykv.nc",
filename = "esw_albedo_Amon_CESM2_historical_r1i1p1f1_gn_185001-201412_v2.nc",
),],
)
path = get_data_folder(land_albedo_dataset)
return joinpath(
path,
"esw_albedo_Amon_CESM2_historical_r1i1p1f1_gn_185001-201412_v2.nc",
)
end

"""
bareground_albedo_dataset_path()
Triggers the download of the average bareground land albedo dataset, if not
already downloaded, using Julia Artifacts, and returns the path to
this file.
This dataset does not contain a time component.
"""
function bareground_albedo_dataset_path(; context = nothing)
dir = joinpath(@__DIR__, "../")
bareground_albedo_dataset = ArtifactWrapper(
dir,
"bareground_albedo",
ArtifactFile[ArtifactFile(
url = "https://caltech.box.com/shared/static/ga9385kyl82t955dylsbnn4x51b412md.nc",
filename = "bareground_albedo.nc",
),],
)
path = get_data_folder(bareground_albedo_dataset)
return joinpath(path, "bareground_albedo.nc")
end

end
Loading

0 comments on commit 0db0092

Please sign in to comment.