-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AWESOME-OCIM data and code download (#76)
- Loading branch information
Showing
4 changed files
with
35 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "AIBECS" | ||
uuid = "ace601d6-714c-11e9-04e5-89b7fad23838" | ||
authors = ["Benoit Pasquier <[email protected]>"] | ||
version = "0.10.2" | ||
version = "0.10.3" | ||
|
||
[deps] | ||
Bijectors = "76274a88-744f-5084-9051-94815aaf08c4" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,17 +11,16 @@ function fallback_download(remotepath, localdir) | |
end | ||
|
||
|
||
function register_AO_files(AO_version) | ||
function register_AO_files() | ||
register( | ||
DataDep( | ||
string("AO_", AO_version, "_files"), | ||
"AWESOME-OCIM", | ||
""" | ||
References for OCIM1: | ||
- DeVries, T., 2014: The oceanic anthropogenic CO2 sink: Storage, air‐sea fluxes, and transports over the industrial era, Global Biogeochem. Cycles, 28, 631–647, doi:10.1002/2013GB004739. | ||
- DeVries, T. and F. Primeau, 2011: Dynamically and Observationally Constrained Estimates of Water-Mass Distributions and Ages in the Global Ocean. J. Phys. Oceanogr., 41, 2381–2401, https://doi.org/10.1175/JPO-D-10-05011.1 | ||
- John, S. G., Liang, H., Weber, T., Devries, T., Primeau, F., Moore, K., Holzer, M., Mahowald, N., Gardner, W., Mishonov, A., Richardson, M., J., Faugere, Y., and Taburet, G. (2020). AWESOME OCIM: A simple, flexible, and powerful tool for modeling elemental cycling in the oceans. Chemical Geology, 533, 119403. doi: 10.1016/j.chemgeo.2019.119403. | ||
""", | ||
string("http://www.mtel.rocks/mtel/awesomeOCIM_files/AwesomeOCIM_", AO_version, ".zip"), | ||
"46b8bfad2b9c73e04cbb2688efd7b477af6ce61ad0340aa894c950c5ba53fa14", | ||
"https://github.com/hengdiliang/AWESOME-OCIM/archive/refs/heads/master.zip", | ||
sha2_256, | ||
fetch_method = fallback_download, | ||
post_fetch_method = unpack | ||
) | ||
|
@@ -33,18 +32,33 @@ end | |
download_and_unpack | ||
Downloads and unpacks the AO zip file from the MTEL website. | ||
Returns the local path of where the AO is installed for you. | ||
""" | ||
function download_and_unpack(AO_version) | ||
register_AO_files(AO_version) | ||
@info """You are about to download (and unpack) the AWESOME OCIM (AO) $AO_version files as a zip file from the MTEL website (https://www.mtel.rocks). | ||
function download_and_unpack() | ||
register_AO_files() | ||
AO_path = datadep"AWESOME-OCIM" | ||
@info """You are about to download (and unpack) the AWESOME OCIM (AO) | ||
files as a zip file from GitHub and unpack them into: | ||
Please check with Seth John ([email protected]) for references to cite if you use the other data contained in the AO files, e.g., GEOTRACES, WOA, etc. | ||
(The references to DeVries et al. pertain to the OCIM v1 product, which is essentially the transport matrix representing the circulation.) | ||
$AO_path | ||
You can run | ||
tree $AO_path | ||
(in shell mode) to check its contents. | ||
Please check with Seth John ([email protected]) for references | ||
to cite if you use the other data contained in the AO files, | ||
e.g., GEOTRACES, WOA, Weber and John, and so on. | ||
Also note that downloading files like this from GitHub is | ||
probably not very robust. However, some of the data files in | ||
the AO repository do not exist anywhere else officially, | ||
therefore this seems like the best solution at this stage. | ||
PRs welcome to improve this! | ||
""" | ||
files_path = @datadep_str string("AO_", AO_version, "_files/") | ||
println("AO folder contains:\n",readdir(files_path)...) | ||
return nothing | ||
return AO_path | ||
end | ||
|
||
end # module | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@testset begin "AWESOME OCIM" | ||
AO_path = AO.download_and_unpack() | ||
@test isdir(AO_path) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8e2aaf0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
8e2aaf0
There was a problem hiding this comment.
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/41381
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: