I made a package, which is in the julia registry, called Spacey.jl
. I added a function to the module and exported it. When I try to using
the package/module, the new function pointGroup
is not found, but names
shows that the function is there. I’m flummoxed. How can I debug this? What basic thing about packages and modules am I misunderstanding? Happy to have someone expose my ignorance.
julia> using Spacey
julia> pLat = [0.5 0.5 0.0; 0.5 0.0 0.5; 0.0 0.5 0.5]
3×3 Matrix{Float64}:
0.5 0.5 0.0
0.5 0.0 0.5
0.0 0.5 0.5
julia> pg = pointGroup(pLat)
ERROR: UndefVarError: `pointGroup` not defined
Stacktrace:
[1] top-level scope
@ REPL[4]:1
julia> names(Spacey)
7-element Vector{Symbol}:
:Spacey
:pointGroup
:pointGroup_fast
:pointGroup_robust
:pointGroup_simple
:snapToSymmetry
:threeDrotation
OK, I still have question about why the pointGroup
function is listed in the output of names(Spacey)
but is not defined when I try to use it…
…but I understand what the problem is generally. Until I push my new changes to github, and then tag a new release, the new code I added to my package is not going to be available when I update
.
I guess what I really want to do is point the code that is using
my Spacey
package to use a local copy, not the copy in the registry. When new changes are debugged and tested, I can push to github, tag a new release, and wait for the update in the julia registry.
In the environment where my new code is, that is using
Spacey, I pointed it to my local copy: (clusterExpansion) pkg> dev /Users/hart/home/JuliaCodes/Spacey.jl/
and now it all works as I (unreasonably) expected when I first posted the question.
julia> using Spacey
julia> pg = pointGroup(pLat)
[output cut to reduce clutter]
julia> names(Spacey)
10-element Vector{Symbol}:
:Spacey
:isagroup
:pointGroup
:pointGroup_fast
:pointGroup_robust
:pointGroup_simple
:snapToSymmetry
:snapToSymmetry_SVD
:snapToSymmetry_avg
:threeDrotation