Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add noise artifact #32

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Artifacts.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name = "UnfoldSim"
uuid = "ed8ae6d2-84d3-44c6-ab46-0baf21700804"
authors = ["Benedikt Ehinger","Luis Lips", "Judith Schepers","Maanik Marathe"]
authors = ["Benedikt Ehinger", "Luis Lips", "Judith Schepers", "Maanik Marathe"]
version = "0.1.6"

[deps]
ArtifactUtils = "8b73e784-e7d8-4ea5-973d-377fed4e3bce"
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
34 changes: 34 additions & 0 deletions src/dev/add_artifact_to_toml.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Pkg.Artifacts, ArtifactsUtils

# Get path to the Artifact.toml
artifacts_toml = joinpath(@__DIR__, "Artifacts.toml")

# Check if noise artefact exists in Artefact.toml and get hash
noise_hash = artifact_hash("RealNoise", artifacts_toml)

# Check if has does not exist (i.e. Artifact not added) or if artifact doesn't exist on disk;
# create/ add to .toml if fullfilled
if isnothing(noise_hash) || !artifact_exists(noise_hash)
add_artifact!(
"Artifacts.toml",
"RealNoise",
"https://github.com/cormullion/juliamono/releases/download/v0.030/JuliaMono.tar.gz", # Change this line to actual dataset
force=true,
lazy=true, # If lazy is set to true, even if download information is available, this artifact will not be downloaded until it is accessed via the artifact"name" syntax, or ensure_artifact_installed() is called upon it.
)
end

#=
For the specific use case of using artifacts that were previously bound,
we have the shorthand notation artifact"name" which will automatically
search for the Artifacts.toml file contained within the current package, look up the given artifact by name,
install it if it is not yet installed, then return the path to that given artifact.
=#


# The following can be used to install the artifact/ ensure it is installed
#import Pkg; Pkg.ensure_artifact_installed("RealNoise", "Artifacts.toml")

# The below can be used to get the path to the artifact file
# According to docs this should also install the Artifact if it is not already installed
# artifact"RealNoise"
Loading