还有个报错
Failed to precompile Bonds [top-level] to C:\Users\zzh666.julia\compiled\v1.3\Bonds.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] compilecache(::Base.PkgId, ::String) at .\loading.jl:1283
[3] _require(::Base.PkgId) at .\loading.jl:1024
[4] require(::Base.PkgId) at .\loading.jl:922
[5] require(::Module, ::Symbol) at .\loading.jl:917
[6] top-level scope at In[9]:15
@info "making edge list zero-based indexed for Python"
keep_xtal = [true for i = 1:length(xtalnames)]
@showprogress for (i_xtal, xtalname) in enumerate(xtalnames)
crystal = Crystal(xtalname * ".cif", include_zero_charges=true;check_overlap=false)
@assert ! all(crystal.charges.q .== 0)
try
bonds!(crystal, true)
catch e
if isa(e, PyCall.PyError)
remove_bonds!(crystal) # some of the bonds were probz formed
println("Voronoi problems with " * crystal.name)
infer_bonds!(crystal, true) # infer bonds with old distance-based version
else
print("!!!", crystal.name); throw(e)
end
end
@assert nv(crystal.bonds) == crystal.atoms.n
if ! PorousMaterials.bond_sanity_check(crystal)
keep_xtal[i_xtal] = false
@warn "throwing out " crystal.name
continue
end
###
# node features
# one-hot encoding. each row is an atom.
###
x_ν = zeros(Int, crystal.atoms.n, length(ATOMS))
for (i, atom) in enumerate(crystal.atoms.species)
x_ν[i, ATOM_TO_INT[atom]] = 1
end
@assert sum(x_ν) == crystal.atoms.n
npzwrite(joinpath("graphs1", xtalname * "_node_features.npy"), x_ν)
###
# node labels (the charges)
###
y_ν = deepcopy(crystal.charges.q)
npzwrite(joinpath("graphs1", xtalname * "_node_labels.npy"), y_ν)
@assert length(y_ν) == size(x_ν)[1]
###
# edges
# (a list and their feature = distance btwn atoms)
###
edge_file = open(joinpath("graphs1", xtalname * ".edge_info"), "w")
@printf(edge_file, "src,dst,r\n")
for ed in edges(crystal.bonds)
i = src(ed) # source
j = dst(ed) # destination
r = distance(crystal.atoms, crystal.box, i, j, true)
@printf(edge_file, "%d,%d,%f\n", i - 1, j - 1, r)
end
close(edge_file)
end
writedlm(open("list_of_crystals.txt", "w"), xtalnames[keep_xtal])
WARNING: both Graphs and LightGraphs export "edges"; uses of it in module Main must be qualified
WARNING: both Graphs and LightGraphs export "nv"; uses of it in module Main must be qualified
WARNING: both Graphs and LightGraphs export "add_edge!"; uses of it in module Bonds must be qualified
WARNING: both Graphs and LightGraphs export "ne"; uses of it in module Bonds must be qualified
WARNING: both Graphs and LightGraphs export "src"; uses of it in module Main must be qualified
WARNING: both Graphs and LightGraphs export "dst"; uses of it in module Main must be qualified
!!!SEHSUU_clean.cifERROR: UndefVarError: ne not defined
Stacktrace:
[1] macro expansion
@ .\REPL[97]:12 [inlined]
[2] top-level scope
@ C:\Users\zzh666\.julia\packages\ProgressMeter\sN2xr\src\ProgressMeter.jl:938
caused by: UndefVarError: ne not defined
Stacktrace:
[1] bonds!(crystal::Crystal, apply_pbc::Bool)
@ Bonds C:\Users\zzh666\Desktop\renwu\renwu13-3\111\mpn_charges-master\build_graphs\Bonds.jl:150
[2] macro expansion
@ .\REPL[97]:5 [inlined]
[3] top-level scope
@ C:\Users\zzh666\.julia\packages\ProgressMeter\sN2xr\src\ProgressMeter.jl:938
刚跑得,似乎Graphs and LightGraphs有这个包
WARNING: both Graphs and LightGraphs export “ne”; uses of it in module Bonds must be qualified