Closed Leticia-maria closed 2 years ago
Here, the problem is not actually with n_atoms
but rather with the min_dist
keyword argument. It was just added in a newer version of Molly. The problem will be solved once you update Molly using:
pkg> update Molly
To add to Jaydev's correct answer: you are right that Int64
is a subtype of Integer
but they are not equal. However the line function place_atoms(n_atoms::Integer ...)
basically means the same thing as function place_atoms(n_atoms::T ...) where T <: Integer
, with the second being useful if you need to use the type T
within the function. Hope that helps!
Hi everyone, I was testing Molly in a new computational resource. I've just tried to reproduce the main example (the fluid in a Lennard Jones potential). An important information is: I was running on Julia 1.8.1.
All was going good,
when the code crashed because I've tried to run this line:
I got the following error:
As the error said, I took a look in the file
setup.jl
(line 25).https://github.com/JuliaMolSim/Molly.jl/blob/47f3e1fd41a9a9daa33732ef7a5c115a3c2e607f/src/setup.jl#L25
As you can see, the method
place_atoms
receives an argument of typeInteger
, butn_atoms
is anInt64
. If you go to the Julia REPL, you will see thatInt64
is a subtype ofInteger
, but they are not equal.The solution is to change the syntax of the function:
I can help solving it by sending a PR.
All my best regards Leticia Madureira