lxvm / AutoBZ.jl

Automatic and adaptive BZ integration for electronic properties
https://lxvm.github.io/AutoBZ.jl/
MIT License
4 stars 1 forks source link

Examples fail to run #46

Closed Luthaf closed 1 month ago

Luthaf commented 1 month ago

This is part of https://github.com/openjournals/joss-reviews/issues/7080

I tried running the default example from the documentation, but it failed with the following error:

$ julia --project kc_benchmark.jl
┌ Info: Symmetry test of the interpolant's Hamiltonian at a random k-point
│   seedname = "svo"
│   kpt = [0.9292277860683943, 0.7662948820656991, 0.7315097036118203]
│   sym = [-1.0 0.0 0.0; 0.0 0.0 -1.0; 0.0 -1.0 0.0]
└   err = 1.4540107379219425e-14
ERROR: LoadError: UndefVarError: `Ω` not defined
Stacktrace:
 [1] top-level scope
   @ ~/.../demos/kc_benchmark.jl:48
in expression starting at ~/.../demos/kc_benchmark.jl:48

Other examples also fail, all with LoadError: MethodError: no method matching init_cacheval: this is chem_pot_test.jl, dos_test.jl, and oc_script.jl.


It might make sense to run the examples on CI regularly to make sure they are always up to date with the latest version of the code.

lxvm commented 1 month ago

Hi @Luthaf, thank you for the issue. I have corrected the typo giving the first bug you mentioned in #38 and will also include the fix for the method error in https://github.com/lxvm/AutoBZCore.jl/pull/13. (The TAI algorithm was not fully reimplemented after breaking API changes.) I was waiting to resolve CI issues related to plotting in that release (v0.5.5) and will also include the scripts in CI as you suggested in that release. I will close the issue when v0.5.5 is merged.

Here is a quick script I use for testing that will become the CI script:

using Pkg
Pkg.activate(; temp=true)
Pkg.develop(path="") # for CI testing
# Pkg.add(url="https://github.com/lxvm/AutoBZ.jl.git", rev="v0.5.5") # for testing releases
using AutoBZ
cd(joinpath(dirname(dirname(pathof(AutoBZ))), "demos"))
include("dos_test.jl")
include("oc_test.jl")
include("chem_pot_test.jl")
include("kc_benchmark.jl")
include("oc_script.jl")
include("dos_interp.jl")
lxvm commented 1 month ago

I added a "Demos" CI in #38 so now all the examples are able to run.