szcf-weiya / DegreesOfFreedom.jl

Julia package for "Degrees of Freedom: Search Cost and Self-consistency"
https://hohoweiya.xyz/DegreesOfFreedom.jl/
MIT License
2 stars 0 forks source link

not allow `~` in folder path? #5

Closed szcf-weiya closed 1 week ago

szcf-weiya commented 1 week ago
julia> run_experiment_splines(folder = "~/Overleaf/paperDoF/res/df")
ERROR: SystemError: opening file "~/Overleaf/paperDoF/res/df/splines-nrep100-nMC100-n100.sil": No such file or directory
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:176
  [2] #systemerror#82
    @ ./error.jl:175 [inlined]
  [3] systemerror
    @ ./error.jl:175 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Bool, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open
    @ ./iostream.jl:275 [inlined]
  [6] open(fname::String, mode::String; lock::Bool)
    @ Base ./iostream.jl:356
  [7] open(fname::String, mode::String)
    @ Base ./iostream.jl:355
  [8] open(::Serialization.var"#1#2"{Matrix{Float64}}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:393
  [9] open
    @ ./io.jl:392 [inlined]
 [10] serialize
    @ /opt/julia/julia-1.9.4/share/julia/stdlib/v1.9/Serialization/src/Serialization.jl:790 [inlined]
 [11] run_experiment_splines(; folder::String, nMC::Int64, n::Int64, nrep::Int64)
    @ DegreesOfFreedom ~/GitHub/DegreesOfFreedom.jl/src/splines.jl:187
 [12] top-level scope
    @ REPL[5]:1
szcf-weiya commented 1 week ago

reproduce it with a simple example

julia> serialize("~/test.sil", a)
ERROR: SystemError: opening file "~/test.sil": No such file or directory

julia> serialize("/home/weiya/test.sil", a)