Closed rogersamso closed 2 years ago
Also, in case you don't know this, since grids_generation.jl
is a script (it contains executable code, not functions), when you include it in the plots2d.jl
file, it will run all the code that is in the grids_generation.jl
.
In other words, every time you run the plots2d.jl
file, you are also running the grids_generation.jl
file.
@rogersamso I have changed the verification in all the files. For the other question, I know that "include" with an script will make it to execute but I don't know more ways to load the code. I am really interested in loading functions, tomorrow, so I will ask more about the topic.
In the plots2d.jl file you do this:
Verifying if the file exists is interesting if you expect your code to read from or write in this file during execution, and you are not sure the file will be there. However, the
grids_generation.jl
file is just part of your code, and you are pretty sure it will be there. Besides, thegrids_generation.jl
is in the same folder than theplots2d.jl
file, therefore theinclude
method does not need the full path of the file to find it. Therefore, you can remove thepath
variable and remove theisfile
validation and just write: