more informative error for cif not in P1 symmetry
SimonEnsemble opened this issue · 1 comments
SimonEnsemble commented
f = Framework("non_P1.cif")
gives an uninformative error message:
ERROR: AssertionError: occursin("P1", line[2] * line[3]) || (occursin("P 1", line[2] * line[3]) || occursin("-P1", line[2] * line[3]))
Stacktrace:
[1] #Framework#4(::Bool, ::Float64, ::Bool, ::Bool, ::Type, ::String) at /home/simoncor/.julia/dev/PorousMaterials/src/Crystal.jl:73
[2] Framework(::String) at /home/simoncor/.julia/dev/PorousMaterials/src/Crystal.jl:40
[3] top-level scope at none:0
can we change to something like "PorousMaterials.jl does not currently support .cif files not in P1 symmetry. Convert your .cif to P1 symmetry using..." and point them to a resource (is it open babel you use @Surluson ?)
ahyork commented
I made a new branch p1_error_information
and I moved the assertion message onto the last line of the check, this fixed it so it properly displays the message now. I can copy over the info on P1 conversion from the docs to the message.
I noticed when I was trying to replicate the error that there isn't a check that the file supplies a symmetry system, should we add this in?