TensorBFS / TensorInference.jl

Probabilistic inference using contraction of tensor networks
https://tensorbfs.github.io/TensorInference.jl/
MIT License
18 stars 2 forks source link

Support data downloading and loading #44

Closed GiggleLiu closed 1 year ago

GiggleLiu commented 1 year ago
          > > 

This change should solve the error you posted.

If you want the readers to use our artifact, you indeed need to tell them to copy this file into their project dir and to include the command that ensures that the artifact gets downloaded (Pkg.ensure_artifact_installed("uai2014", "Artifacts.toml")).

Instead of Pkg.ensure_artifact_installed("uai2014", "Artifacts.toml"), can we build the function into our package so that in the documentation we can write:

julia> TensorInference.download_data("uai2014")

julia> TensorInference.load_data("uai2014", name, task)

We still have Artifacts as a dependency, but will not download data automaticall for users. Because it is very anoying when a user was told to find a specific file in his filesystem to follow a documentation. Especially for windows users.

Originally posted by @GiggleLiu in https://github.com/TensorBFS/TensorInference.jl/issues/41#issuecomment-1630819190

mroavi commented 1 year ago

Since we already have read_instance, read_instance_from_string, we could name this new function read_instance_from_artifact to keep the naming consistent. I was also thinking that perhaps we could always do the check (Pkg.ensure_artifact_installed(artifact_name, artifact_toml)) inside this function so that it becomes transparent to the user.