Skip to content

Commit

Permalink
Merge pull request #56 from euroargodev/v0p1p20b
Browse files Browse the repository at this point in the history
add extensions
  • Loading branch information
gaelforget authored Aug 16, 2024
2 parents 83d6d5f + ee5d409 commit e57d5c5
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 16 deletions.
13 changes: 13 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,19 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

[weakdeps]
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"

[extensions]
ArgoDataCondaExt = ["Conda"]
ArgoDataMakieExt = ["Makie"]
ArgoDataPyCallExt = ["PyCall"]

[compat]
CSV = "0.10"
Conda = "1"
Bootstrap = "2"
Climatology = "0.5"
DataFrames = "1"
Expand All @@ -32,9 +43,11 @@ FTPClient = "1"
Glob = "1"
Interpolations = "0.13, 0.14, 0.15"
JLD2 = "0.4"
Makie = "0.21"
MeshArrays = "0.3"
NCDatasets = "0.12, 0.13, 0.14"
OrderedCollections = "1"
PyCall = "1"
Statistics = "1"
YAML = "0.4"
julia = "1.9"
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ using Documenter, ArgoData, PlutoSliderServer

using Climatology, MITgcm
ENV["DATADEPS_ALWAYS_ACCEPT"]=true
Climatology.MITPROFclim_download()
pth=Climatology.MITPROFclim_download()
println(pth)

#python dependencies
if false
Expand Down
90 changes: 75 additions & 15 deletions examples/ArgoToMITprof.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[compat]
ArgoData = "~0.1.14"
NCDatasets = "~0.12.9"
PlutoUI = "~0.7.49"
PrettyTables = "~2.2.2"
"""

# ╔═╡ 00000000-0000-0000-0000-000000000002
Expand All @@ -148,7 +146,7 @@ PLUTO_MANIFEST_TOML_CONTENTS = """
julia_version = "1.10.4"
manifest_format = "2.0"
project_hash = "d748463479da7e14a46705f43e52d07311b3262c"
project_hash = "3370e2e0eba24bed5740ba91ea4ed9bc2381501c"
[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
Expand Down Expand Up @@ -193,6 +191,12 @@ git-tree-sha1 = "0691e34b3bb8be9307330f88d1a3c3f25466c24d"
uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35"
version = "0.1.9"
[[deps.Blosc_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Lz4_jll", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "19b98ee7e3db3b4eff74c5c9c72bf32144e24f10"
uuid = "0b7ba130-8d10-5ba8-a3d6-c5182647fed9"
version = "1.21.5+0"
[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "9e2a6b69137e6969bab0152632dcb3bc108c8bdd"
Expand Down Expand Up @@ -240,10 +244,10 @@ uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.5"
[[deps.CommonDataModel]]
deps = ["CFTime", "DataStructures", "Dates", "Preferences", "Printf"]
git-tree-sha1 = "7f5717cbb2c1ce650cfd454451f282df33103596"
deps = ["CFTime", "DataStructures", "Dates", "Preferences", "Printf", "Statistics"]
git-tree-sha1 = "d6fb5bf939a2753c74984b11434ea25d6c397a58"
uuid = "1fbeeb36-5f17-413c-809b-666fb144f157"
version = "0.2.5"
version = "0.3.6"
[[deps.Compat]]
deps = ["TOML", "UUIDs"]
Expand Down Expand Up @@ -317,6 +321,12 @@ version = "0.2.5"
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[deps.DiskArrays]]
deps = ["LRUCache", "OffsetArrays"]
git-tree-sha1 = "ef25c513cad08d7ebbed158c91768ae32f308336"
uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3"
version = "0.3.23"
[[deps.Distances]]
deps = ["LinearAlgebra", "Statistics", "StatsAPI"]
git-tree-sha1 = "66c4c81f259586e8f002eacebc177e1fb06363b0"
Expand Down Expand Up @@ -374,11 +384,22 @@ version = "0.8.5"
deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
[[deps.GMP_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "781609d7-10c4-51f6-84f2-b8444358ff6d"
version = "6.2.1+6"
[[deps.Glob]]
git-tree-sha1 = "97285bbd5230dd766e9ef6749b80fc617126d496"
uuid = "c27321d9-0574-5035-807b-f59d2c89b15c"
version = "1.3.1"
[[deps.GnuTLS_jll]]
deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Nettle_jll", "P11Kit_jll", "Zlib_jll"]
git-tree-sha1 = "383db7d3f900f4c1f47a8a04115b053c095e48d3"
uuid = "0951126a-58fd-58f1-b5b3-b08c7c4a876d"
version = "3.8.4+0"
[[deps.HDF5_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LazyArtifacts", "LibCURL_jll", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "OpenSSL_jll", "TOML", "Zlib_jll", "libaec_jll"]
git-tree-sha1 = "82a471768b513dc39e471540fdadc84ff80ff997"
Expand Down Expand Up @@ -470,6 +491,15 @@ git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.4"
[[deps.LRUCache]]
git-tree-sha1 = "b3cc6698599b10e652832c2f23db3cab99d51b59"
uuid = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"
version = "1.6.1"
weakdeps = ["Serialization"]
[deps.LRUCache.extensions]
SerializationExt = ["Serialization"]
[[deps.LaTeXStrings]]
git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec"
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Expand Down Expand Up @@ -525,6 +555,12 @@ git-tree-sha1 = "c1dd6d7978c12545b4179fb6153b9250c96b0075"
uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36"
version = "1.0.3"
[[deps.Lz4_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "7f26c8fc5229e68484e0b3447312c98e16207d11"
uuid = "5ced341a-0733-55b8-9ab6-a4889d929147"
version = "1.10.0+0"
[[deps.MIMEs]]
git-tree-sha1 = "65f28ad4b594aebe22157d6fac869786a255b7eb"
uuid = "6c6e2e6c-3030-632d-7369-2d6c69616d65"
Expand Down Expand Up @@ -611,10 +647,10 @@ uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
version = "2023.1.10"
[[deps.NCDatasets]]
deps = ["CFTime", "CommonDataModel", "DataStructures", "Dates", "NetCDF_jll", "NetworkOptions", "Printf"]
git-tree-sha1 = "4263c4220f22e20729329838bf7e94a49d1ac32f"
deps = ["CFTime", "CommonDataModel", "DataStructures", "Dates", "DiskArrays", "NetCDF_jll", "NetworkOptions", "Printf"]
git-tree-sha1 = "a640912695952b074672edb5f9aaee2f7f9fd59a"
uuid = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
version = "0.12.17"
version = "0.14.4"
[[deps.NearestNeighbors]]
deps = ["Distances", "StaticArrays"]
Expand All @@ -623,10 +659,16 @@ uuid = "b8a86587-4115-5ab1-83bc-aa920d37bbce"
version = "0.4.18"
[[deps.NetCDF_jll]]
deps = ["Artifacts", "Bzip2_jll", "HDF5_jll", "JLLWrappers", "LibCURL_jll", "Libdl", "XML2_jll", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "10c612c81eaffdd6b7c28a45a554cdd9d2f40ff1"
deps = ["Artifacts", "Blosc_jll", "Bzip2_jll", "HDF5_jll", "JLLWrappers", "LazyArtifacts", "LibCURL_jll", "Libdl", "MPICH_jll", "MPIPreferences", "MPItrampoline_jll", "MicrosoftMPI_jll", "OpenMPI_jll", "TOML", "XML2_jll", "Zlib_jll", "Zstd_jll", "libzip_jll"]
git-tree-sha1 = "4686378c4ae1d1948cfbe46c002a11a4265dcb07"
uuid = "7243133f-43d8-5620-bbf4-c2c921802cf3"
version = "400.902.208+0"
version = "400.902.211+1"
[[deps.Nettle_jll]]
deps = ["Artifacts", "GMP_jll", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "eca63e3847dad608cfa6a3329b95ef674c7160b4"
uuid = "4c82536e-c426-54e4-b420-14f461c4ed8b"
version = "3.7.2+0"
[[deps.NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
Expand Down Expand Up @@ -683,6 +725,12 @@ git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.6.3"
[[deps.P11Kit_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "2cd396108e178f3ae8dedbd8e938a18726ab2fbf"
uuid = "c2071276-7c44-58a7-b746-946036e04d0a"
version = "0.24.1+0"
[[deps.Parsers]]
deps = ["Dates", "PrecompileTools", "UUIDs"]
git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821"
Expand Down Expand Up @@ -719,10 +767,10 @@ uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.4.3"
[[deps.PrettyTables]]
deps = ["Crayons", "LaTeXStrings", "Markdown", "Printf", "Reexport", "StringManipulation", "Tables"]
git-tree-sha1 = "6842ce83a836fbbc0cfeca0b5a4de1a4dcbdb8d1"
deps = ["Crayons", "LaTeXStrings", "Markdown", "PrecompileTools", "Printf", "Reexport", "StringManipulation", "Tables"]
git-tree-sha1 = "66b20dd35966a748321d3b2537c4584cf40387c7"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "2.2.8"
version = "2.3.2"
[[deps.Printf]]
deps = ["Unicode"]
Expand Down Expand Up @@ -934,6 +982,12 @@ git-tree-sha1 = "d9717ce3518dc68a99e6b96300813760d887a01d"
uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a"
version = "2.13.1+0"
[[deps.XZ_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl"]
git-tree-sha1 = "ac88fb95ae6447c8dda6a5503f3bafd496ae8632"
uuid = "ffd25f8a-64ca-5728-b0f7-c24cf3aae800"
version = "5.4.6+0"
[[deps.YAML]]
deps = ["Base64", "Dates", "Printf", "StringEncodings"]
git-tree-sha1 = "dea63ff72079443240fbd013ba006bcbc8a9ac00"
Expand Down Expand Up @@ -968,6 +1022,12 @@ deps = ["Artifacts", "Libdl"]
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
version = "5.8.0+1"
[[deps.libzip_jll]]
deps = ["Artifacts", "Bzip2_jll", "GnuTLS_jll", "JLLWrappers", "Libdl", "XZ_jll", "Zlib_jll", "Zstd_jll"]
git-tree-sha1 = "3282b7d16ae7ac3e57ec2f3fa8fafb564d8f9f7f"
uuid = "337d8026-41b4-5cde-a456-74a10e5b31d1"
version = "1.10.1+0"
[[deps.nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
Expand Down
13 changes: 13 additions & 0 deletions ext/ArgoDataCondaExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module ArgoDataCondaExt

using Conda, ArgoData

function ArgoData.conda(flag=:argopy)
if flag==:argopy
Conda.add("argopy")
# Conda.pip_interop(true)
# Conda.pip("install", "argopy")
end
end

end
8 changes: 8 additions & 0 deletions ext/ArgoDataMakieExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module ArgoDataMakieExt

using ArgoData, Makie

end



13 changes: 13 additions & 0 deletions ext/ArgoDataPyCallExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module ArgoDataPyCallExt

using PyCall, ArgoData

function ArgoData.pyimport(flag=:argopy)
if flag==:argopy
PyCall.pyimport("argopy")
else
@warn "unknown flag value "
end
end

end
3 changes: 3 additions & 0 deletions src/ArgoData.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ export GDAC, ArgoTools, GriddedFields
export MITprof, MITprofAnalysis, MITprofStat
export ProfileNative, ProfileStandard, MITprofStandard

conda(dev::String) = conda(:pyargo)
pyimport(dev::String) = pyimport(:pyargo)

end # module
3 changes: 3 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[deps]
Climatology = "9e9a4d37-2d2e-41e3-8b85-f7978328d9c7"
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
MITgcm = "dce5fa8e-68ce-4431-a242-9469c69627a0"
MeshArrays = "cb8c808f-1acf-59a3-9d2b-6e38d009f683"
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
15 changes: 15 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ using Climatology, MITgcm
ENV["DATADEPS_ALWAYS_ACCEPT"]=true
Climatology.MITPROFclim_download()

if Sys.ARCH!==:aarch64
if false #external python path
tmpfile=joinpath(tempdir(),"pythonpath.txt")
run(pipeline(`which python`,tmpfile))
ENV["PYTHON"]=readline(tmpfile)
else #internal python path
ENV["PYTHON"]=""
end
using Pkg; Pkg.build("PyCall")

using PyCall, Conda
ArgoData.conda(:argopy)
argopy=ArgoData.pyimport(:argopy)
end

@testset "ArgoData.jl" begin

files_list=GDAC.files_list()
Expand Down

0 comments on commit e57d5c5

Please sign in to comment.