Skip to content

Commit

Permalink
fix: pass local path to joinpath
Browse files Browse the repository at this point in the history
  • Loading branch information
fjebaker committed Sep 20, 2023
1 parent fedda47 commit 406a644
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/model-data-io.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const DEFAULT_DOWNLOAD_ROOT_URL::String = "https://www.star.bris.ac.uk/fergus/xspec/data/"
MODEL_DATA_STORAGE_PATH =
joinpath(LibXSPEC_jll.artifact_dir, "spectral", "modelData")
MODEL_DATA_STORAGE_PATH = joinpath(LibXSPEC_jll.artifact_dir, "spectral", "modelData")

struct ModelDataInfo
remote_path::String
Expand Down Expand Up @@ -164,7 +163,7 @@ function download_model_data(s::Symbol; verbose = true, kwargs...)
dest = joinpath(MODEL_DATA_STORAGE_PATH, src.local_path)
if !ispath(dest)
_download_from_archive(src.remote_path, dest; kwargs...)
_infolog("$src downloaded")
_infolog("$(src.local_path) downloaded")
end
end
_infolog("All requisite model data for $s downloaded.")
Expand All @@ -179,10 +178,10 @@ function ensure_model_data(M::Type)
end

function load_and_unpack_model_data(M)
files = _model_to_data_map[Base.typename(M).name]
data = _model_to_data_map[Base.typename(M).name]
# load all of the data files
contents = map(files) do f
path = joinpath(MODEL_DATA_STORAGE_PATH, f)
contents = map(data) do f
path = joinpath(MODEL_DATA_STORAGE_PATH, f.local_path)
load(path)
end
contents
Expand Down

0 comments on commit 406a644

Please sign in to comment.