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

Error when running example code #4

Open
xieduo7 opened this issue Sep 22, 2022 · 2 comments
Open

Error when running example code #4

xieduo7 opened this issue Sep 22, 2022 · 2 comments

Comments

@xieduo7
Copy link

xieduo7 commented Sep 22, 2022

I run it as follows:

julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.7.3 (2022-05-06)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Pkg

julia> Pkg.activate("/data/xieduo/software/J-Space.jl")
  Activating project at `/data/xieduo/software/J-Space.jl`

julia> using J_Space

julia> Start_J_Space("Parameters.toml","Config.toml")
START...
CREATE/LOAD GRAPH....
RUN DYNAMIC....
save plot...
ERROR: SystemError: opening file "/data/xieduo/software/J-Space.jl/test/.\\Plot\\/Conf_t_10.png": No such file or directory
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:174
  [2] #systemerror#68
    @ ./error.jl:173 [inlined]
  [3] systemerror
    @ ./error.jl:173 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Bool, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open(fname::String, mode::String; lock::Bool)
    @ Base ./iostream.jl:355
  [6] open(fname::String, mode::String)
    @ Base ./iostream.jl:355
  [7] open(::Makie.var"#917#918"{Float64, Float64, Bool, DataType, Makie.Scene}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:328
  [8] open
    @ ./io.jl:328 [inlined]
  [9] save(file::FileIO.File{FileIO.DataFormat{:PNG}, String}, fig::Makie.Figure; resolution::Tuple{Int64, Int64}, pt_per_unit::Float64, px_per_unit::Float64, update::Bool)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:246
 [10] save(file::FileIO.File{FileIO.DataFormat{:PNG}, String}, fig::Makie.Figure)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:228
 [11] save(filename::String, fig::Makie.Figure; args::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:218
 [12] save(filename::String, fig::Makie.Figure)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:218
 [13] Start_J_Space(paramaters::String, config::String)
    @ J_Space /data/xieduo/software/J-Space.jl/src/Start.jl:130
 [14] top-level scope
    @ REPL[4]:1

julia> Start_J_Space("Parameters.toml","Config.toml")
START...
CREATE/LOAD GRAPH....
RUN DYNAMIC....
save plot...
ERROR: SystemError: opening file "/data/xieduo/software/J-Space.jl/test/.\\Plot\\/Conf_t_10.png": No such file or directory
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:174
  [2] #systemerror#68
    @ ./error.jl:173 [inlined]
  [3] systemerror
    @ ./error.jl:173 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Bool, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open(fname::String, mode::String; lock::Bool)
    @ Base ./iostream.jl:355
  [6] open(fname::String, mode::String)
    @ Base ./iostream.jl:355
  [7] open(::Makie.var"#917#918"{Float64, Float64, Bool, DataType, Makie.Scene}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:328
  [8] open
    @ ./io.jl:328 [inlined]
  [9] save(file::FileIO.File{FileIO.DataFormat{:PNG}, String}, fig::Makie.Figure; resolution::Tuple{Int64, Int64}, pt_per_unit::Float64, px_per_unit::Float64, update::Bool)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:246
 [10] save(file::FileIO.File{FileIO.DataFormat{:PNG}, String}, fig::Makie.Figure)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:228
 [11] save(filename::String, fig::Makie.Figure; args::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:218
 [12] save(filename::String, fig::Makie.Figure)
    @ Makie ~/.julia/packages/Makie/gQOQF/src/display.jl:218
 [13] Start_J_Space(paramaters::String, config::String)
    @ J_Space /data/xieduo/software/J-Space.jl/src/Start.jl:130
 [14] top-level scope
    @ REPL[4]:1

Do you have any suggestions?

Best,
Duo

@Alessandro-Guidi
Copy link
Collaborator

Alessandro-Guidi commented Sep 23, 2022

Hi @xieduo7,
Start_J_Space is the main function of J-Space, if you want to use it you must first set the parameters in the toml file, in this case, they are "Config.toml" and "Parameters.toml". In particular, the error occurs because in the Config file, in the field "path_to_save_plot", the value is ".\Plot\" and this is for the Windows environment. You must replace it with "./Plot/".
For further information, the README explained all the fields of the toml files. (If anyone is unclear, you can open an issue to improve the descriptions).

To execute an example, please refer to the "RUN THE EXAMPLES" section of the README.
A possible example to run is as follows: Move in the main folder of J-Space, using the command line run
julia --project=. ./Experiments/Experiment_2D/experiment_2D.jl.
Otherwise, in the Example directory, there are several examples explaining how to use the functions in J-Space, with a README for each script.

Alessandro

@marcoxa
Copy link
Member

marcoxa commented Sep 23, 2022

Alessandro....

./Path/

will work on W10/W11 as well.

MA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants