CASMcode
CASMcode copied to clipboard
[WIP] Import fix
I have fixed the import error caused by an existing properties.calc.json
as described in #320. I fixed the segfault for empty force in #313. For an empty value
field like this:
"atom_properties": {
"force": {
"value": []
}
}
the import will fail, but there is now an error message instead of a segfault. If value
is missing there will also be an error message and the import will fail. The import is already successful if there is no force
field, but now I have hardcoded force
to be always optional, so the import will work for the above JSON. This seems a bit risky - it would probably be better to pass a list of optional properties.
I also updated some documentation:
-
import_properties
is false by default - changed the help string from
additional_files
tocopy_additional_files
-
copy_additional_files
requirescopy_structure_files
-
copy_structure_files
impliesimport_properties
because it copiesproperties.calc.json
Two things that I did not address are that the copy_additional_files
option prints every copied file to stdout, which is a lot of printing, and the documentation for cp_files
says that it returns whether or not files were copied, but I don't think that it does.
the fix contains files with the extension "cc" , but the original file are with the extension of "hh".