You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attempting to read AVSfld format files is failing due (apparently) to FileIO not properly loading the required AVSfldIO package. I thought the magic of require in FileIO would take care of this automatically. I tried the suggested Pkg.instantiate() but that did not help. The only solution I have found is to explicitly add AVSfileIO and invoke it with using but I thought that FileIO was supposed to make that happen behind the scenes without user intervention. It makes me suspect that my original PR #333 for this format was somehow incomplete. Here is a MWE that writes some test data to a .fld file and then attempts to load it.
using FileIO
#using AVSfldIO # Must add this package and uncomment this line for code to work
buf =IOBuffer()
write(buf, "# AVS\n", "ndim=2\n", "dim1=3\n", "dim2=4\n",
"nspace=2\n", "veclen=1\n", "data=float_le\n", "field=uniform\n",
'\f', '\f', Float32.(1:12)) # test data
file ="tmp.fld"open(file, "w") do io write(io, take!(buf)) endload(file)
Error encountered while load File{DataFormat{:AVSfld}, String}("tmp.fld").
Fatal error:
ERROR: LoadError: ArgumentError: Package AVSfldIO [b6189060-daf9-4c28-845a-cc0984b81781] is required but does not seem to be installed:- Run `Pkg.instantiate()` to install all recorded dependencies.
Stacktrace:
[1] _require(pkg::Base.PkgId)
@ Base ./loading.jl:1089
[2] require(uuidkey::Base.PkgId)
@ Base ./loading.jl:1013
[3] #34
@ ~/.julia/packages/FileIO/FUXWu/src/loadsave.jl:203 [inlined]
[4] lock(f::FileIO.var"#34#35"{Base.PkgId}, l::ReentrantLock)
@ Base ./lock.jl:190
[5] action(::Symbol, ::Vector{Union{Base.PkgId, Module}}, ::Formatted; options::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ FileIO ~/.julia/packages/FileIO/FUXWu/src/loadsave.jl:203
Originally AVSfldIO.jl was under my github site and then we moved it under JulioIO organization. Could that move have made it harder for FileIO to locate? I doubt it, but I am at a loss for why this is not working. Thanks!
The text was updated successfully, but these errors were encountered:
To be clear, FileIO currently does not handle package installation. Thus AVSfldIO must be installed somewhere in the load path to work:
julia>LOAD_PATH3-element Vector{String}:"@"# (IIUC) current project environment"@v#.#"# root environment; ~/.julia/environments/v1.7/Project.toml"@stdlib"
Pkg.instantiate only works if AVSfldIO is listed as a dependency in Project.toml; so one option is to still keep MIRTio in the Project.toml in JeffFessler/MIRT.jl#108 but does not use using MIRTio explicitly; this guarantees that any environment with MIRT installed has MIRTio available in the load path.
Attempting to read
AVSfld
format files is failing due (apparently) to FileIO not properly loading the requiredAVSfldIO
package. I thought the magic ofrequire
in FileIO would take care of this automatically. I tried the suggestedPkg.instantiate()
but that did not help. The only solution I have found is to explicitly addAVSfileIO
and invoke it withusing
but I thought that FileIO was supposed to make that happen behind the scenes without user intervention. It makes me suspect that my original PR #333 for this format was somehow incomplete. Here is a MWE that writes some test data to a.fld
file and then attempts to load it.Originally AVSfldIO.jl was under my github site and then we moved it under JulioIO organization. Could that move have made it harder for FileIO to locate? I doubt it, but I am at a loss for why this is not working. Thanks!
The text was updated successfully, but these errors were encountered: