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

compute_forces_cart not found? #371

Closed
stur86 opened this issue Nov 17, 2020 · 15 comments · Fixed by #372
Closed

compute_forces_cart not found? #371

stur86 opened this issue Nov 17, 2020 · 15 comments · Fixed by #372
Labels
documentation Correcting or expanding documentation

Comments

@stur86
Copy link

stur86 commented Nov 17, 2020

I've just installed DFTK using Pkg.add("DFTK") on Julia 1.4.1. The version used is v0.1.17. When I try using the command compute_forces_cart after importing DFTK and using it to solve the first tutorial the symbol can not be found. DFTK has methods compute_bands compute_current compute_density compute_kernel compute_partial_density! compute_χ0 but not for forces. Is this a bug, or do I simply need to update to the master version?

@antoine-levitt
Copy link
Member

Yes that's a recent addition, you need to update to the newest version (or we need to tag a new version). Try add DFTK#master at the Pkg command line.

@antoine-levitt
Copy link
Member

Ah yes this is because the documentation points to the master version. Hm. The proper solution could be to have two links, to dev and stable version, but given we do release new versions relatively frequently, we might as well systematically tag new versions when we make doc changes? Or tell the users to always install master versions, since we are relatively careful not to break master...

@stur86
Copy link
Author

stur86 commented Nov 17, 2020

Ok, thanks, will do. Yes, maybe the documentation should be a bit clearer. Also, when I try, I get ERROR: "DFTK#master" is not a valid package name so there might be another problem there.

@antoine-levitt
Copy link
Member

Really? I just tried

(@v1.5) pkg> add FFTW#master
    Cloning git-repo `https://github.com/JuliaMath/FFTW.jl.git`
   Updating git-repo `https://github.com/JuliaMath/FFTW.jl.git`
   Updating registry at `~/.julia/registries/General`
######################################################################## 100.0%
  Resolving package versions...
Updating `~/.julia/environments/v1.5/Project.toml`
  [7a1cc6ca] ~ FFTW v1.2.4 ⇒ v1.2.4 `https://github.com/JuliaMath/FFTW.jl.git#master`
Updating `~/.julia/environments/v1.5/Manifest.toml`
  [7a1cc6ca] ~ FFTW v1.2.4 ⇒ v1.2.4 `https://github.com/JuliaMath/FFTW.jl.git#master`

Where does your error come from?

@mfherbst
Copy link
Member

The proper solution could be to have two links, to dev and stable version

Yes that's a good idea and not too hard to achieve.

Or tell the users to always install master versions, since we are relatively careful not to break master...

I veto that and you know it 😄

@mfherbst mfherbst added the documentation Correcting or expanding documentation label Nov 17, 2020
@antoine-levitt
Copy link
Member

Can't blame me for trying ;-)

@stur86
Copy link
Author

stur86 commented Nov 17, 2020

Really? I just tried

(@v1.5) pkg> add FFTW#master
    Cloning git-repo `https://github.com/JuliaMath/FFTW.jl.git`
   Updating git-repo `https://github.com/JuliaMath/FFTW.jl.git`
   Updating registry at `~/.julia/registries/General`
######################################################################## 100.0%
  Resolving package versions...
Updating `~/.julia/environments/v1.5/Project.toml`
  [7a1cc6ca] ~ FFTW v1.2.4 ⇒ v1.2.4 `https://github.com/JuliaMath/FFTW.jl.git#master`
Updating `~/.julia/environments/v1.5/Manifest.toml`
  [7a1cc6ca] ~ FFTW v1.2.4 ⇒ v1.2.4 `https://github.com/JuliaMath/FFTW.jl.git#master`

Where does your error come from?

The error was me trying to use Pkg.add("DFTK#master") from the Julia interpreter instead of using the REPL. I'd suggest that that needs fixing in the documentation too! The # probably confuses the interpreter.

@mfherbst
Copy link
Member

mfherbst commented Nov 17, 2020

Ah yes, that's indeed a typo. The correct command is

Pkg.add(name="DFTK", rev="master")

@antoine-levitt
Copy link
Member

You have to use using DFTK (like with any other julia package) to get the names exported.

@antoine-levitt
Copy link
Member

If there's a import DFTK in the docs it's a mistake

@mfherbst
Copy link
Member

By the way ... docs and badge will be fixed in #372. Should go into master today.

@stur86
Copy link
Author

stur86 commented Nov 17, 2020

If there's a import DFTK in the docs it's a mistake

Sorry, yes, I realised my mistake afterwards, hence why I deleted my post. Didn't notice the difference between using and import. I'm a novice at Julia.

@antoine-levitt
Copy link
Member

Ah I was confused because the post appeared, disappeared and re-appeared. No worries, it takes a while to get these julia idiosyncrasies, especially if you don't have a julia afficionado on hand.

@mfherbst
Copy link
Member

Actually it is very confusing and subject to debate amongst the Julia community. You're not the first to fall into that trap @stur86 😄.

@antoine-levitt
Copy link
Member

Yeah I agree it's a bit annoying. Back when I started julia there was even importall which was even more confusing. Now I just always use using...

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

Successfully merging a pull request may close this issue.

3 participants