jarvist / ApproxEffectiveMass

Effective mass from a (VASP?) bandstructure calculation via ApproxFun fitting to the bands, a WIP.
9 stars 1 forks source link

Error while running julia code #1

Closed chemst closed 5 years ago

chemst commented 6 years ago

Hi, I am running ApproxEffectiveMass.jl in linux and getting the error Hello world! Imports successful... ERROR: LoadError: MethodError: Cannot convert an object of type Array{Float64,1} to an object of type ApproxFun.PeriodicDomain This may have arisen from a call to the constructor ApproxFun.PeriodicDomain(...), since type constructors fall back to convert methods. Stacktrace: [1] ApproxFun.SumSpace{Tuple{ApproxFun.CosSpace{DD,RR},ApproxFun.SinSpace{DD,RR}},DD,RR} where RR where DD(::Array{Float64,1}) at /home/simil/.julia/v0.6/ApproxFun/src/Spaces/Fourier/Fourier.jl:314 [2] include_from_node1(::String) at ./loading.jl:576 [3] include(::String) at ./sysimg.jl:14 while loading /home/ApproxEffectiveMass-master/ApproxEffectiveMass.jl, in expression starting on line 6

I am using julia Version 0.6.2. Could you point out the problem?

jarvist commented 6 years ago

I'll try and have a look!

Bear in mind these are experimental codes, developed just to play with an ApproxFun approach to band structures.

jarvist commented 6 years ago

OK, found some time to investigate + fix. It was due to the ApproxFun call signatures changing quite significantly (generally the function now comes first, and the interval / space second). Luckily I had already experienced this problem with a derivative code last summer.

I tagged v0.2 to be a minimally changed repository, patching the codes to run more or less correctly on 0.6.2. One issue is that the plot extrema labels don't match up any more (the Fourier range is periodic, naturally).

https://github.com/jarvist/ApproxEffectiveMass/releases/tag/v0.2

Hopefully I will be able to make the time over the next few weeks to clean up this repo + make the code more general / reusable. Hopefully we'll also add the ApproxFun method to a group paper on calculating effective masses

Please do reopen this issue if it still does not work; if there are feature requests / other issues, please open a new one. Thank you for your interest!

dwaipayanroni commented 5 years ago

Hi, I am having the same problem like:

Hello world! Imports successful... ERROR: LoadError: LoadError: UndefVarError: @sprintf not defined Stacktrace: [1] top-level scope [2] include at ./boot.jl:326 [inlined] [3] include_relative(::Module, ::String) at ./loading.jl:1038 [4] include(::Module, ::String) at ./sysimg.jl:29 [5] exec_options(::Base.JLOptions) at ./client.jl:267 [6] _start() at ./client.jl:436 in expression starting at /home/dwaipayan/ApproxEffectiveMass-0.2/ApproxEffectiveMass.jl:32 in expression starting at /home/dwaipayan/ApproxEffectiveMass-0.2/ApproxEffectiveMass.jl:7

I am using the julia version 1.1.0

jarvist commented 5 years ago

Hi, That's because this code is currently a bit old + stale. In Julia 0.7 onwards, they moved some functionality into separate packages. At the very least, this will require adding an additional using Printf in the preamble of the module. If I have time I'll try it on Julia 1.1 and patch, if it doesn't require too much refactoring! Best, Jarv

jarvist commented 5 years ago

Hi, https://github.com/jarvist/ApproxEffectiveMass/commit/d77c515f5facef879a87aac02c789739e37389cf should have fixed all these problems. There were a few places where the language syntax had changed. I've tagged a new release 1.0 to show that they are compatible. Enjoy!